Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e62ccf3a authored by Linus Walleij's avatar Linus Walleij Committed by Samuel Ortiz
Browse files

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: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 1934dae2
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -1433,17 +1433,20 @@ 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
	default:
		break;
	}
	if (clock < PRCMU_NUM_REG_CLOCKS)
		return request_reg_clock(clock, enable);
	return -EINVAL;
}