Merge branch 'omap/dt-missed-3.4' into drivers/mmc
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / arm / mach-omap2 / gpio.c
index 2f994e5194e85c932836421f79b90fe7efe0ce4c..18f9c7bd72003e616f3cc01beebc31dfd01fe5b1 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/err.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
+#include <linux/of.h>
 
 #include <plat/omap_hwmod.h>
 #include <plat/omap_device.h>
@@ -146,7 +147,10 @@ static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
  */
 static int __init omap2_gpio_init(void)
 {
-       return omap_hwmod_for_each_by_class("gpio", omap2_gpio_dev_init,
-                                               NULL);
+       /* If dtb is there, the devices will be created dynamically */
+       if (of_have_populated_dt())
+               return -ENODEV;
+
+       return omap_hwmod_for_each_by_class("gpio", omap2_gpio_dev_init, NULL);
 }
 postcore_initcall(omap2_gpio_init);