Skip to content

Commit ab0b00b

Browse files
joshradeldedekind
authored andcommitted
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 <jradel@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
1 parent 9b7ef60 commit ab0b00b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎drivers/mtd/ofpart.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ static int parse_ofpart_partitions(struct mtd_info *master,
7171
(*pparts)[i].name = (char *)partname;
7272

7373
if (of_get_property(pp, "read-only", &len))
74-
(*pparts)[i].mask_flags = MTD_WRITEABLE;
74+
(*pparts)[i].mask_flags |= MTD_WRITEABLE;
75+
76+
if (of_get_property(pp, "lock", &len))
77+
(*pparts)[i].mask_flags |= MTD_POWERUP_LOCK;
7578

7679
i++;
7780
}

0 commit comments

Comments
 (0)