In order to support sub-nodes with the sram driver,
have the sram driver call of_probe_default_children().

This will allow for supportting sram based reboot reasons.

Cc: Andy Yan <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Heiko Stübner <[email protected]>
Cc: Caesar Wang <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Guodong Xu <[email protected]>
Cc: Haojian Zhuang <[email protected]>
Cc: Vishal Bhoj <[email protected]>
Cc: Bjorn Andersson <[email protected]>
Cc: [email protected]
Cc: Android Kernel Team <[email protected]>
Signed-off-by: John Stultz <[email protected]>
---
 drivers/misc/sram.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c
index f84b53d..6830a79 100644
--- a/drivers/misc/sram.c
+++ b/drivers/misc/sram.c
@@ -23,6 +23,7 @@
 #include <linux/io.h>
 #include <linux/list_sort.h>
 #include <linux/of_address.h>
+#include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 
@@ -384,6 +385,8 @@ static int sram_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, sram);
 
+       of_platform_default_populate(pdev->dev.of_node,
+                                               NULL, &pdev->dev);
        dev_dbg(sram->dev, "SRAM pool: %zu KiB @ 0x%p\n",
                gen_pool_size(sram->pool) / 1024, sram->virt_base);
 
-- 
1.9.1

Reply via email to