]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM OMAP2+ GPMC: add bus children
authorRobert ABEL <rabel@cit-ec.uni-bielefeld.de>
Fri, 27 Feb 2015 15:56:49 +0000 (16:56 +0100)
committerRoger Quadros <rogerq@ti.com>
Fri, 6 Mar 2015 10:22:25 +0000 (12:22 +0200)
This patch adds support for spawning buses as children of the GPMC.

Signed-off-by: Robert ABEL <rabel@cit-ec.uni-bielefeld.de>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
drivers/memory/omap-gpmc.c

index 624dccb0f002fe6c006da422c35d500911379ce4..91b5a1b9b9c237e24ff8e21fefeaab56c8e8d6f3 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/of_address.h>
 #include <linux/of_mtd.h>
 #include <linux/of_device.h>
+#include <linux/of_platform.h>
 #include <linux/omap-gpmc.h>
 #include <linux/mtd/nand.h>
 #include <linux/pm_runtime.h>
@@ -1812,8 +1813,21 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
        gpmc_cs_enable_mem(cs);
 
 no_timings:
-       if (of_platform_device_create(child, NULL, &pdev->dev))
-               return 0;
+
+       /* create platform device, NULL on error or when disabled */
+       if (!of_platform_device_create(child, NULL, &pdev->dev))
+               goto err_child_fail;
+
+       /* is child a common bus? */
+       if (of_match_node(of_default_bus_match_table, child))
+               /* create children and other common bus children */
+               if (of_platform_populate(child, of_default_bus_match_table,
+                                        NULL, &pdev->dev))
+                       goto err_child_fail;
+
+       return 0;
+
+err_child_fail:
 
        dev_err(&pdev->dev, "failed to create gpmc child %s\n", child->name);
        ret = -ENODEV;