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 <andy....@rock-chips.com>
Cc: Rob Herring <r...@kernel.org>
Cc: Arnd Bergmann <a...@arndb.de>
Cc: Thierry Reding <tred...@nvidia.com>
Cc: Heiko Stübner <he...@sntech.de>
Cc: Caesar Wang <w...@rock-chips.com>
Cc: Kees Cook <keesc...@chromium.org>
Cc: Guodong Xu <guodong...@linaro.org>
Cc: Haojian Zhuang <haojian.zhu...@linaro.org>
Cc: Vishal Bhoj <vishal.b...@linaro.org>
Cc: Bjorn Andersson <bjorn.anders...@linaro.org>
Cc: devicet...@vger.kernel.org
Cc: Android Kernel Team <kernel-t...@android.com>
Signed-off-by: John Stultz <john.stu...@linaro.org>
---
 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