From patchwork Wed Nov 14 22:11:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1/1] mtd: ofpart: Replicate mtd cmdline "lk" option with device tree "lock" property Date: Wed, 14 Nov 2012 12:11:32 -0000 From: Josh Radel X-Patchwork-Id: 199037 Message-Id: <1352931092-8916-1-git-send-email-jradel@gmail.com> To: David Woodhouse Cc: linux-mtd@lists.infradead.org, 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. Signed-off-by: Josh Radel --- drivers/mtd/ofpart.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c index d9127e2..dbd3aa5 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++; }