Re: [PATCH 06/23] mfd/db8500-prcmu: add accessors for PLL and SGAclock

From: Samuel Ortiz
Date: Mon Oct 03 2011 - 11:48:57 EST


Hi Linus,

On Fri, Aug 12, 2011 at 10:28:18AM +0200, Linus Walleij wrote:
> int db8500_prcmu_request_clock(u8 clock, bool enable)
> {
> - if (clock < PRCMU_NUM_REG_CLOCKS)
> + if (clock == 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)
> return request_timclk(enable);
> else if (clock == PRCMU_SYSCLK)
> return request_sysclk(enable);
> + else if (clock == PRCMU_PLLSOC1)
> + return request_pll(clock, enable);
> else
> return -EINVAL;
This looks like you're willing to use a switch case here (and default to
request_reg_clock() who would return -EINVAL if clock >=
PRCMU_NUM_REG_CLOCKS).

Cheers,
Samuel.

--
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/