From: Robert ABEL Date: Fri, 27 Feb 2015 15:56:49 +0000 (+0100) Subject: ARM OMAP2+ GPMC: add bus children X-Git-Tag: v4.1-rc1~49^2~4^2~6 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b1dc1ca9d4673dac43b8a77a8b695ffb2918de2a;p=karo-tx-linux.git ARM OMAP2+ GPMC: add bus children This patch adds support for spawning buses as children of the GPMC. Signed-off-by: Robert ABEL Acked-by: Tony Lindgren Signed-off-by: Roger Quadros --- diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index 624dccb0f002..91b5a1b9b9c2 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -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;