aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/gpio.c')
-rw-r--r--arch/arm/mach-omap2/gpio.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
index 064cab03d2bd..a80e093b039f 100644
--- a/arch/arm/mach-omap2/gpio.c
+++ b/arch/arm/mach-omap2/gpio.c
@@ -20,6 +20,7 @@
20#include <linux/err.h> 20#include <linux/err.h>
21#include <linux/slab.h> 21#include <linux/slab.h>
22#include <linux/interrupt.h> 22#include <linux/interrupt.h>
23#include <linux/of.h>
23 24
24#include <plat/omap_hwmod.h> 25#include <plat/omap_hwmod.h>
25#include <plat/omap_device.h> 26#include <plat/omap_device.h>
@@ -146,7 +147,10 @@ static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
146 */ 147 */
147static int __init omap2_gpio_init(void) 148static int __init omap2_gpio_init(void)
148{ 149{
149 return omap_hwmod_for_each_by_class("gpio", omap2_gpio_dev_init, 150 /* If dtb is there, the devices will be created dynamically */
150 NULL); 151 if (of_have_populated_dt())
152 return -ENODEV;
153
154 return omap_hwmod_for_each_by_class("gpio", omap2_gpio_dev_init, NULL);
151} 155}
152postcore_initcall(omap2_gpio_init); 156postcore_initcall(omap2_gpio_init);