diff options
author | Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com> | 2008-10-15 11:13:47 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2009-09-02 18:08:23 -0400 |
commit | a23456e9b02b3fae0fc78cb33fad69803a50e5bc (patch) | |
tree | d74c8b6ed9600bc605fcd74ac4f3dfd5f6a52910 /arch/arm/mach-omap2/clockdomain.c | |
parent | fe617af716bc09cbbdd11ad820d5818017a9f481 (diff) |
OMAP: PM: Add closures to clkdm_for_each and pwrdm_for_each.
Add some infrastructure to easily iterate over clock and power
domains.
Signed-off-by: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-omap2/clockdomain.c')
-rw-r--r-- | arch/arm/mach-omap2/clockdomain.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c index 5b0b90b76e13..4ef7b4f5474e 100644 --- a/arch/arm/mach-omap2/clockdomain.c +++ b/arch/arm/mach-omap2/clockdomain.c | |||
@@ -299,7 +299,8 @@ struct clockdomain *clkdm_lookup(const char *name) | |||
299 | * anything else to indicate failure; or -EINVAL if the function pointer | 299 | * anything else to indicate failure; or -EINVAL if the function pointer |
300 | * is null. | 300 | * is null. |
301 | */ | 301 | */ |
302 | int clkdm_for_each(int (*fn)(struct clockdomain *clkdm)) | 302 | int clkdm_for_each(int (*fn)(struct clockdomain *clkdm, void *user), |
303 | void *user) | ||
303 | { | 304 | { |
304 | struct clockdomain *clkdm; | 305 | struct clockdomain *clkdm; |
305 | int ret = 0; | 306 | int ret = 0; |
@@ -309,7 +310,7 @@ int clkdm_for_each(int (*fn)(struct clockdomain *clkdm)) | |||
309 | 310 | ||
310 | mutex_lock(&clkdm_mutex); | 311 | mutex_lock(&clkdm_mutex); |
311 | list_for_each_entry(clkdm, &clkdm_list, node) { | 312 | list_for_each_entry(clkdm, &clkdm_list, node) { |
312 | ret = (*fn)(clkdm); | 313 | ret = (*fn)(clkdm, user); |
313 | if (ret) | 314 | if (ret) |
314 | break; | 315 | break; |
315 | } | 316 | } |