aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2011-10-10 06:14:14 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2011-10-24 08:09:19 -0400
commite62ccf3a7a21d62d92520f47ba5bd7e2112d8c1b (patch)
tree56577cca7446604dd67dac2f6595dc9cafc1cb6e /drivers/mfd
parent1934dae220ed1f1a832a191a86c1becfcbb3a094 (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.c19
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 */
1434int db8500_prcmu_request_clock(u8 clock, bool enable) 1434int 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
1450int db8500_prcmu_config_esram0_deep_sleep(u8 state) 1453int db8500_prcmu_config_esram0_deep_sleep(u8 state)