summaryrefslogtreecommitdiff
path: root/ubi-utils/src/libmtd.c
diff options
context:
space:
mode:
Diffstat (limited to 'ubi-utils/src/libmtd.c')
-rw-r--r--ubi-utils/src/libmtd.c6
1 files changed, 3 insertions, 3 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;