]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - include/linux/mtd/mtd.h
mtd: Introduce mtd_block_isreserved()
[karo-tx-uboot.git] / include / linux / mtd / mtd.h
index 1526d075c7889f04e6117d230f2982d15b7cdc5a..cf5cda15d1ae0906504a4bb4d8af7caf8b919f90 100644 (file)
@@ -8,7 +8,6 @@
 #ifndef __MTD_MTD_H__
 #define __MTD_MTD_H__
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/types.h>
 #include <linux/uio.h>
@@ -239,6 +238,7 @@ struct mtd_info {
        int (*_lock) (struct mtd_info *mtd, loff_t ofs, uint64_t len);
        int (*_unlock) (struct mtd_info *mtd, loff_t ofs, uint64_t len);
        int (*_is_locked) (struct mtd_info *mtd, loff_t ofs, uint64_t len);
+       int (*_block_isreserved) (struct mtd_info *mtd, loff_t ofs);
        int (*_block_isbad) (struct mtd_info *mtd, loff_t ofs);
        int (*_block_markbad) (struct mtd_info *mtd, loff_t ofs);
 #ifndef __UBOOT__
@@ -329,6 +329,7 @@ static inline void mtd_sync(struct mtd_info *mtd)
 int mtd_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
 int mtd_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
 int mtd_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len);
+int mtd_block_isreserved(struct mtd_info *mtd, loff_t ofs);
 int mtd_block_isbad(struct mtd_info *mtd, loff_t ofs);
 int mtd_block_markbad(struct mtd_info *mtd, loff_t ofs);
 
@@ -483,5 +484,11 @@ int add_mtd_device(struct mtd_info *mtd);
 int del_mtd_device(struct mtd_info *mtd);
 int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int);
 int del_mtd_partitions(struct mtd_info *);
+
+int mtd_arg_off(const char *arg, int *idx, loff_t *off, loff_t *size,
+               loff_t *maxsize, int devtype, uint64_t chipsize);
+int mtd_arg_off_size(int argc, char *const argv[], int *idx, loff_t *off,
+                    loff_t *size, loff_t *maxsize, int devtype,
+                    uint64_t chipsize);
 #endif
 #endif /* __MTD_MTD_H__ */