public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] mtd: powernv: Support MTD_NO_ERASE
@ 2017-09-05 20:23 William A. Kennington III
  2017-09-21  7:59 ` Boris Brezillon
  0 siblings, 1 reply; 8+ messages in thread
From: William A. Kennington III @ 2017-09-05 20:23 UTC (permalink / raw)
  To: linux-mtd; +Cc: wak

As of skiboot@ba99af9b149d02438347b055e6e7d6bd15e33551, we now support
adding a device tree entry which marks a flash device as not needing
erase. This patch adds support for setting MTD_NO_ERASE on powernvflash
devices which have the property no-erase.

Signed-off-by: William A. Kennington III <wak@google.com>
---
 drivers/mtd/devices/powernv_flash.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mtd/devices/powernv_flash.c b/drivers/mtd/devices/powernv_flash.c
index f5396f26ddb4..fab9f9121b4c 100644
--- a/drivers/mtd/devices/powernv_flash.c
+++ b/drivers/mtd/devices/powernv_flash.c
@@ -196,6 +196,8 @@ static int powernv_flash_set_driver_info(struct device *dev,
 	mtd->name = of_get_property(dev->of_node, "name", NULL);
 	mtd->type = MTD_NORFLASH;
 	mtd->flags = MTD_WRITEABLE;
+	if (of_property_read_bool(dev->of_node, "no-erase"))
+		mtd->flags |= MTD_NO_ERASE;
 	mtd->size = size;
 	mtd->erasesize = erase_size;
 	mtd->writebufsize = mtd->writesize = 1;
-- 
2.13.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-10-30 15:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-05 20:23 [PATCH] mtd: powernv: Support MTD_NO_ERASE William A. Kennington III
2017-09-21  7:59 ` Boris Brezillon
     [not found]   ` <CAPnigKmBujCoKdtXwnK6YsU=YvXM+MaDvDvKpUXEVgHzOC-VEw@mail.gmail.com>
2017-09-22  4:13     ` Michael Ellerman
2017-10-16 15:55       ` Boris Brezillon
2017-10-17 13:21         ` Rob Herring
2017-10-18  5:11           ` Stewart Smith
2017-10-30  8:48             ` Boris Brezillon
2017-10-30 15:23             ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox