diff mbox series

[6/8] mtd: partitions: ofpart: Parse the slc-mode property

Message ID 20191230165129.11925-7-miquel.raynal@bootlin.com
State Changes Requested
Delegated to: Miquel Raynal
Headers show
Series MLC in SLC mode | expand

Commit Message

Miquel Raynal Dec. 30, 2019, 4:51 p.m. UTC
From: Boris Brezillon <boris.brezillon@bootlin.com>

Parse the slc-mode property and set the MTD_MLC_IN_SLC_MODE flag when
present.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/parsers/ofpart.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/drivers/mtd/parsers/ofpart.c b/drivers/mtd/parsers/ofpart.c
index 3caeabf27987..0a67fd15ab54 100644
--- a/drivers/mtd/parsers/ofpart.c
+++ b/drivers/mtd/parsers/ofpart.c
@@ -117,6 +117,9 @@  static int parse_fixed_partitions(struct mtd_info *master,
 		if (of_get_property(pp, "lock", &len))
 			parts[i].mask_flags |= MTD_POWERUP_LOCK;
 
+		if (of_property_read_bool(pp, "slc-mode"))
+			parts[i].add_flags |= MTD_MLC_IN_SLC_MODE;
+
 		i++;
 	}