@@ -13,6 +13,7 @@
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/of_platform.h>
+#include <linux/of_dependencies.h>
#include <linux/wl12xx.h>
#include <linux/platform_data/pinctrl-single.h>
@@ -312,7 +313,14 @@ void __init pdata_quirks_init(struct of_device_id *omap_dt_match_table)
{
omap_sdrc_init(NULL, NULL);
pdata_quirks_check(auxdata_quirks);
+#ifdef CONFIG_OF_DEPENDENCIES
+ if (!of_init_build_order(NULL, NULL))
+ of_init_create_devices(NULL, omap_auxdata_lookup);
+ else
+ of_init_free_order();
+#else
of_platform_populate(NULL, omap_dt_match_table,
omap_auxdata_lookup, NULL);
+#endif
pdata_quirks_check(pdata_quirks);
}
@@ -78,10 +78,15 @@ static int pwmss_probe(struct platform_device *pdev)
pm_runtime_get_sync(&pdev->dev);
platform_set_drvdata(pdev, info);
+#ifndef CONFIG_OF_DEPENDENCIES
/* Populate all the child nodes here... */
ret = of_platform_populate(node, NULL, NULL, &pdev->dev);
if (ret)
dev_err(&pdev->dev, "no child node found\n");
+#else
+ /* dependency based initialization already has setup devices */
+ ret = 0;
+#endif
return ret;
}
Use the feature of dependency based initialization order for drivers if CONFIG_OF_DEPENDENCIES is enabled. This patch also includes a change for a driver which does call of_platform_populate() itself. This shouldn't be done or necessary when CONFIG_OF_DEPENDENCIES is enabled. Signed-off-by: Alexander Holler <holler@ahsoftware.de> --- arch/arm/mach-omap2/pdata-quirks.c | 8 ++++++++ drivers/pwm/pwm-tipwmss.c | 5 +++++ 2 files changed, 13 insertions(+)