Merge tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[linux-2.6-block.git] / arch / arm / mach-omap2 / omap_hwmod.c
index 921c9aaee63f590bc352ad14f16e3c3206fb6832..b5531dd3ae9c36b5b165b314ba39d2e0a9cd8264 100644 (file)
@@ -2345,6 +2345,17 @@ static int __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data,
        return 0;
 }
 
+static void __init parse_module_flags(struct omap_hwmod *oh,
+                                     struct device_node *np)
+{
+       if (of_find_property(np, "ti,no-reset-on-init", NULL))
+               oh->flags |= HWMOD_INIT_NO_RESET;
+       if (of_find_property(np, "ti,no-idle-on-init", NULL))
+               oh->flags |= HWMOD_INIT_NO_IDLE;
+       if (of_find_property(np, "ti,no-idle", NULL))
+               oh->flags |= HWMOD_NO_IDLE;
+}
+
 /**
  * _init - initialize internal data for the hwmod @oh
  * @oh: struct omap_hwmod *
@@ -2392,12 +2403,12 @@ static int __init _init(struct omap_hwmod *oh, void *data)
        }
 
        if (np) {
-               if (of_find_property(np, "ti,no-reset-on-init", NULL))
-                       oh->flags |= HWMOD_INIT_NO_RESET;
-               if (of_find_property(np, "ti,no-idle-on-init", NULL))
-                       oh->flags |= HWMOD_INIT_NO_IDLE;
-               if (of_find_property(np, "ti,no-idle", NULL))
-                       oh->flags |= HWMOD_NO_IDLE;
+               struct device_node *child;
+
+               parse_module_flags(oh, np);
+               child = of_get_next_child(np, NULL);
+               if (child)
+                       parse_module_flags(oh, child);
        }
 
        oh->_state = _HWMOD_STATE_INITIALIZED;