diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2011-10-10 06:14:14 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-10-24 08:09:19 -0400 |
commit | e62ccf3a7a21d62d92520f47ba5bd7e2112d8c1b (patch) | |
tree | 56577cca7446604dd67dac2f6595dc9cafc1cb6e /drivers/mfd | |
parent | 1934dae220ed1f1a832a191a86c1becfcbb3a094 (diff) |
mfd: Refactor db8500-prcmu request_clock() function
This refactors the mfd/dbx500-prcmu drivers to use a switch()
statement rather than nested if/else-construction.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/db8500-prcmu.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index 98da431af044..e996d11980fa 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c | |||
@@ -1433,18 +1433,21 @@ static int request_sga_clock(u8 clock, bool enable) | |||
1433 | */ | 1433 | */ |
1434 | int db8500_prcmu_request_clock(u8 clock, bool enable) | 1434 | int db8500_prcmu_request_clock(u8 clock, bool enable) |
1435 | { | 1435 | { |
1436 | if (clock == PRCMU_SGACLK) | 1436 | switch(clock) { |
1437 | case PRCMU_SGACLK: | ||
1437 | return request_sga_clock(clock, enable); | 1438 | return request_sga_clock(clock, enable); |
1438 | else if (clock < PRCMU_NUM_REG_CLOCKS) | 1439 | case PRCMU_TIMCLK: |
1439 | return request_reg_clock(clock, enable); | ||
1440 | else if (clock == PRCMU_TIMCLK) | ||
1441 | return request_timclk(enable); | 1440 | return request_timclk(enable); |
1442 | else if (clock == PRCMU_SYSCLK) | 1441 | case PRCMU_SYSCLK: |
1443 | return request_sysclk(enable); | 1442 | return request_sysclk(enable); |
1444 | else if (clock == PRCMU_PLLSOC1) | 1443 | case PRCMU_PLLSOC1: |
1445 | return request_pll(clock, enable); | 1444 | return request_pll(clock, enable); |
1446 | else | 1445 | default: |
1447 | return -EINVAL; | 1446 | break; |
1447 | } | ||
1448 | if (clock < PRCMU_NUM_REG_CLOCKS) | ||
1449 | return request_reg_clock(clock, enable); | ||
1450 | return -EINVAL; | ||
1448 | } | 1451 | } |
1449 | 1452 | ||
1450 | int db8500_prcmu_config_esram0_deep_sleep(u8 state) | 1453 | int db8500_prcmu_config_esram0_deep_sleep(u8 state) |