]> www.infradead.org Git - mtd-utils.git/commitdiff
libmtd: rename allows_bb field
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Sun, 26 Apr 2009 05:11:58 +0000 (08:11 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Fri, 8 May 2009 16:07:26 +0000 (19:07 +0300)
This is a preparation for the coming sysfs support.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
ubi-utils/include/libmtd.h
ubi-utils/src/libmtd.c
ubi-utils/src/ubiformat.c

index bcc2de24d0cb2a3008f6c1653368bbeb2f6c31e6..2d7d451e6682a070bf6356f9a472ad98c6de098d 100644 (file)
@@ -40,7 +40,7 @@ extern "C" {
  * @min_io_size: minimum input/output unit size
  * @subpage_size: sub-page size
  * @rdonly: non-zero if the device is read-only
- * @allows_bb: non-zero if the MTD device may have bad eraseblocks
+ * @bb_allowed: non-zero if the MTD device may have bad eraseblocks
  */
 struct mtd_dev_info
 {
@@ -55,7 +55,7 @@ struct mtd_dev_info
        int min_io_size;
        int subpage_size;
        unsigned int rdonly:1;
-       unsigned int allows_bb:1;
+       unsigned int bb_allowed:1;
 };
 
 /**
index dc9287a50def016d75c68f771d76f96e120d06a1..b61f97441beef115fc17d3b3083ccb4eb3f9e1ff 100644 (file)
@@ -76,9 +76,9 @@ int mtd_get_dev_info(const char *node, struct mtd_dev_info *mtd)
                        goto out_close;
                }
                errno = 0;
-               mtd->allows_bb = 0;
+               mtd->bb_allowed = 0;
        } else
-               mtd->allows_bb = 1;
+               mtd->bb_allowed = 1;
 
        mtd->type = ui.type;
        mtd->size = ui.size;
@@ -162,7 +162,7 @@ int mtd_is_bad(const struct mtd_dev_info *mtd, int fd, int eb)
                return -1;
        }
 
-       if (!mtd->allows_bb)
+       if (!mtd->bb_allowed)
                return 0;
 
        seek = (loff_t)eb * mtd->eb_size;
@@ -178,7 +178,7 @@ int mtd_mark_bad(const struct mtd_dev_info *mtd, int fd, int eb)
        int ret;
        loff_t seek;
 
-       if (!mtd->allows_bb) {
+       if (!mtd->bb_allowed) {
                errno = EINVAL;
                return -1;
        }
index ac236f757b984e9a7406b4501bb44b4ed91bd736..686c4191d9d1e65e2b66ccdcc6b6a4dbf629c399 100644 (file)
@@ -407,7 +407,7 @@ static int mark_bad(const struct mtd_dev_info *mtd, struct ubi_scan_info *si, in
        if (!args.quiet)
                printf("\n");
 
-       if (!mtd->allows_bb) {
+       if (!mtd->bb_allowed) {
                if (!args.quiet)
                        printf("\n");
                return errmsg("bad blocks not supported by this flash");