Skip to contentSkip to conversation

mtd: ofpart: Replicate mtd cmdline "lk" option with device tree "lock" property

PATCH Applied Josh Radel 2 participants 2 messages Nov 14, 2012 – Nov 22, 2012 Memory technology devices (MTD)

lore
Share & tools
lore

Josh Radel

author
#0 lore raw

PATCH 1/1 mtd: ofpart: Replicate mtd cmdline "lk" option with device tree "lock" property

The mtd partition command line parser already supports a "lk" option to mask MTD_POWERUP_LOCK. This extends that same functionality to device tree partition specifications.

---
 drivers/mtd/ofpart.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/mtd/ofpart.c +4 -1
index d9127e2..dbd3aa5 100644
@@ -71,7 +71,10 @@ static int parse_ofpart_partitions(struct mtd_info *master,
 		(*pparts)[i].name = (char *)partname;
 
 		if (of_get_property(pp, "read-only", &len))
-			(*pparts)[i].mask_flags = MTD_WRITEABLE;
+			(*pparts)[i].mask_flags |= MTD_WRITEABLE;
+
+		if (of_get_property(pp, "lock", &len))
+			(*pparts)[i].mask_flags |= MTD_POWERUP_LOCK;
 
 		i++;
 	}
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 5 lines · Josh Radel

The mtd partition command line parser already supports a "lk" option to mask MTD_POWERUP_LOCK. This extends that same functionality to device tree partition specifications.

Pushed to l2-mtd.git, thanks!

Signature · 2 lines
Best Regards,
Artem Bityutskiy