devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 1/3] mtd: core: call devm_of_platform_populate() for MTD devices
@ 2021-12-30  9:04 Rafał Miłecki
  2021-12-30  9:04 ` [PATCH V2 2/3] dt-bindings: nvmem: add U-Boot environment variables binding Rafał Miłecki
  2021-12-30  9:04 ` [PATCH V2 3/3] nvmem: add driver handling U-Boot environment variables Rafał Miłecki
  0 siblings, 2 replies; 7+ messages in thread
From: Rafał Miłecki @ 2021-12-30  9:04 UTC (permalink / raw)
  To: Srinivas Kandagatla, Rob Herring, Miquel Raynal,
	Richard Weinberger, Vignesh Raghavendra
  Cc: devicetree, linux-kernel, linux-mtd, Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

This adds support for bindings present in MTD devices (applies to
partitions too) nodes. The purpose of this change is to allow drivers
handle MTD device (partition) data. Some partitions may contain info
that requires parsing & processing.

An example can be U-Boot partition that contains block with environment
variables somehwere in a middle. That block should be described in DT
and parsed by a specific driver.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 drivers/mtd/mtdcore.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 70f492dce158..07b75e6ca111 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -19,6 +19,7 @@
 #include <linux/ioctl.h>
 #include <linux/init.h>
 #include <linux/of.h>
+#include <linux/of_platform.h>
 #include <linux/proc_fs.h>
 #include <linux/idr.h>
 #include <linux/backing-dev.h>
@@ -690,6 +691,9 @@ int add_mtd_device(struct mtd_info *mtd)
 		not->add(mtd);
 
 	mutex_unlock(&mtd_table_mutex);
+
+	devm_of_platform_populate(&mtd->dev);
+
 	/* We _know_ we aren't being removed, because
 	   our caller is still holding us here. So none
 	   of this try_ nonsense, and no bitching about it
-- 
2.31.1


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

end of thread, other threads:[~2022-01-10 20:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-30  9:04 [PATCH V2 1/3] mtd: core: call devm_of_platform_populate() for MTD devices Rafał Miłecki
2021-12-30  9:04 ` [PATCH V2 2/3] dt-bindings: nvmem: add U-Boot environment variables binding Rafał Miłecki
2022-01-10 20:30   ` Rob Herring
2021-12-30  9:04 ` [PATCH V2 3/3] nvmem: add driver handling U-Boot environment variables Rafał Miłecki
2022-01-05  7:40   ` kernel test robot
2022-01-05 11:33   ` kernel test robot
2022-01-05 12:24   ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).