From: Josh Radel Date: Wed, 14 Nov 2012 22:11:32 +0000 (-0800) Subject: mtd: ofpart: Replicate mtd cmdline "lk" option with device tree "lock" property X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ab0b00bc6ebcfbff42dedb3bf53f0ece79b27e88;p=linux-beck.git 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. Signed-off-by: Josh Radel Signed-off-by: Artem Bityutskiy --- diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c index d9127e2ed808..dbd3aa574eaf 100644 --- a/drivers/mtd/ofpart.c +++ b/drivers/mtd/ofpart.c @@ -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++; }