diff options
author | Paul Walmsley <paul@pwsan.com> | 2011-02-23 02:14:06 -0500 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2011-02-28 14:04:25 -0500 |
commit | bac1a0f0bbf0b11b23fe714826f29fc9aeb35855 (patch) | |
tree | 663236a6d8b986e66d83642d8b3b13aa137226af /arch/arm/mach-omap2/omap_hwmod.c | |
parent | ce722d269ff85ab11aa680784bcc6eff06e3e3ea (diff) |
OMAP2+: hwmod: allow multiple calls to omap_hwmod_init()
There's no longer any reason why we should prevent multiple
calls to omap_hwmod_init(). It is now simply used to register an
array of hwmods.
This should allow a subset of hwmods (e.g., hwmods
handling the system clocksource and clockevents) to be registered
earlier than the remaining mass of hwmods.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: BenoƮt Cousson <b-cousson@ti.com>
Cc: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/omap_hwmod.c')
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod.c | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 9e89a58711b7..2a7ab6adee82 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -162,9 +162,6 @@ static LIST_HEAD(omap_hwmod_list); | |||
162 | /* mpu_oh: used to add/remove MPU initiator from sleepdep list */ | 162 | /* mpu_oh: used to add/remove MPU initiator from sleepdep list */ |
163 | static struct omap_hwmod *mpu_oh; | 163 | static struct omap_hwmod *mpu_oh; |
164 | 164 | ||
165 | /* inited: 0 if omap_hwmod_init() has not yet been called; 1 otherwise */ | ||
166 | static u8 inited; | ||
167 | |||
168 | 165 | ||
169 | /* Private functions */ | 166 | /* Private functions */ |
170 | 167 | ||
@@ -1595,26 +1592,20 @@ int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data), | |||
1595 | */ | 1592 | */ |
1596 | int __init omap_hwmod_init(struct omap_hwmod **ohs) | 1593 | int __init omap_hwmod_init(struct omap_hwmod **ohs) |
1597 | { | 1594 | { |
1598 | struct omap_hwmod *oh; | 1595 | int r, i; |
1599 | int r; | ||
1600 | |||
1601 | if (inited) | ||
1602 | return -EINVAL; | ||
1603 | |||
1604 | inited = 1; | ||
1605 | 1596 | ||
1606 | if (!ohs) | 1597 | if (!ohs) |
1607 | return 0; | 1598 | return 0; |
1608 | 1599 | ||
1609 | oh = *ohs; | 1600 | i = 0; |
1610 | while (oh) { | 1601 | do { |
1611 | if (omap_chip_is(oh->omap_chip)) { | 1602 | if (!omap_chip_is(ohs[i]->omap_chip)) |
1612 | r = _register(oh); | 1603 | continue; |
1613 | WARN(r, "omap_hwmod: %s: _register returned " | 1604 | |
1614 | "%d\n", oh->name, r); | 1605 | r = _register(ohs[i]); |
1615 | } | 1606 | WARN(r, "omap_hwmod: %s: _register returned %d\n", ohs[i]->name, |
1616 | oh = *++ohs; | 1607 | r); |
1617 | } | 1608 | } while (ohs[++i]); |
1618 | 1609 | ||
1619 | return 0; | 1610 | return 0; |
1620 | } | 1611 | } |