Skip to content

Commit

Permalink
mfd: Refactor db8500-prcmu request_clock() function
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Linus Walleij authored and Samuel Ortiz committed Oct 24, 2011
1 parent 1934dae commit e62ccf3
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions drivers/mfd/db8500-prcmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1433,18 +1433,21 @@ static int request_sga_clock(u8 clock, bool enable)
*/
int db8500_prcmu_request_clock(u8 clock, bool enable)
{
if (clock == PRCMU_SGACLK)
switch(clock) {
case PRCMU_SGACLK:
return request_sga_clock(clock, enable);
else if (clock < PRCMU_NUM_REG_CLOCKS)
return request_reg_clock(clock, enable);
else if (clock == PRCMU_TIMCLK)
case PRCMU_TIMCLK:
return request_timclk(enable);
else if (clock == PRCMU_SYSCLK)
case PRCMU_SYSCLK:
return request_sysclk(enable);
else if (clock == PRCMU_PLLSOC1)
case PRCMU_PLLSOC1:
return request_pll(clock, enable);
else
return -EINVAL;
default:
break;
}
if (clock < PRCMU_NUM_REG_CLOCKS)
return request_reg_clock(clock, enable);
return -EINVAL;
}

int db8500_prcmu_config_esram0_deep_sleep(u8 state)
Expand Down

0 comments on commit e62ccf3

Please sign in to comment.