Re: [PATCH 4/4] mfd: as3722: introduce regmap support

From: Mark Brown
Date: Wed Aug 21 2013 - 14:30:52 EST


On Tue, Aug 20, 2013 at 01:13:30PM +0200, Florian Lobmaier wrote:

> +static bool as3722_readable(struct device *dev, unsigned int reg)
> +{
> + switch (reg) {
> + case AS3722_SD0_VOLTAGE_REG:
> + case AS3722_SD1_VOLTAGE_REG:

If there are no gaps in this a simple if ( >= <= ) would do - the switch
statements are normally used for sparse register maps with lots of gaps.

> +static bool as3722_volatile(struct device *dev, unsigned int reg)
> +{
> + return false;
> +}

At least the interrupt status registers ought to be volatile.
Alternatively this function can be removed as non-volatile is the
default.

Attachment: signature.asc
Description: Digital signature