提交 e62ccf3a 编写于 作者: L Linus Walleij 提交者: Samuel Ortiz

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: NLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 1934dae2
...@@ -1433,18 +1433,21 @@ static int request_sga_clock(u8 clock, bool enable) ...@@ -1433,18 +1433,21 @@ static int request_sga_clock(u8 clock, bool enable)
*/ */
int db8500_prcmu_request_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); return request_sga_clock(clock, enable);
else if (clock < PRCMU_NUM_REG_CLOCKS) case PRCMU_TIMCLK:
return request_reg_clock(clock, enable);
else if (clock == PRCMU_TIMCLK)
return request_timclk(enable); return request_timclk(enable);
else if (clock == PRCMU_SYSCLK) case PRCMU_SYSCLK:
return request_sysclk(enable); return request_sysclk(enable);
else if (clock == PRCMU_PLLSOC1) case PRCMU_PLLSOC1:
return request_pll(clock, enable); return request_pll(clock, enable);
else default:
return -EINVAL; break;
}
if (clock < PRCMU_NUM_REG_CLOCKS)
return request_reg_clock(clock, enable);
return -EINVAL;
} }
int db8500_prcmu_config_esram0_deep_sleep(u8 state) int db8500_prcmu_config_esram0_deep_sleep(u8 state)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册