diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-04-26 08:15:47 +0300 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-05-08 19:07:26 +0300 |
commit | ff17b78ed0e37eb288460d87873599eae748cde7 (patch) | |
tree | c5f38c0c1b4b8cb869f1f93406d88b66108cf783 /ubi-utils/src | |
parent | 2d57b66a576109db6a0a538377b744c06ed47451 (diff) |
libmtd: rename rdonly field
This is a preparation for the coming sysfs support.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'ubi-utils/src')
-rw-r--r-- | ubi-utils/src/libmtd.c | 6 | ||||
-rw-r--r-- | ubi-utils/src/ubiformat.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/ubi-utils/src/libmtd.c b/ubi-utils/src/libmtd.c index b61f974..7675dcd 100644 --- a/ubi-utils/src/libmtd.c +++ b/ubi-utils/src/libmtd.c @@ -58,7 +58,7 @@ int mtd_get_dev_info(const char *node, struct mtd_dev_info *mtd) } mtd->num = mtd->minor / 2; - mtd->rdonly = mtd->minor & 1; + mtd->writable = !(mtd->minor & 1); fd = open(node, O_RDWR); if (fd == -1) @@ -130,8 +130,8 @@ int mtd_get_dev_info(const char *node, struct mtd_dev_info *mtd) break; } - if (!(ui.flags & MTD_WRITEABLE)) - mtd->rdonly = 1; + if (ui.flags & MTD_WRITEABLE) + mtd->writable = 1; close(fd); return 0; diff --git a/ubi-utils/src/ubiformat.c b/ubi-utils/src/ubiformat.c index 686c419..b64d187 100644 --- a/ubi-utils/src/ubiformat.c +++ b/ubi-utils/src/ubiformat.c @@ -732,7 +732,7 @@ int main(int argc, char * const argv[]) */ mtd.subpage_size = args.subpage_size; - if (mtd.rdonly) { + if (!mtd.writable) { errmsg("mtd%d (%s) is a read-only device", mtd.num, args.node); goto out; } |