On Thu, Aug 18, 2011 at 07:23:22PM +0530, ashishj3 wrote:

> +int da9052_reg_read(struct da9052 *da9052, unsigned char reg)
> +{
> +     int val, ret;
> +
> +     if (reg > DA9052_MAX_REG_CNT) {
> +             dev_err(da9052->dev, "invalid reg %x\n", reg);
> +             return -EINVAL;
> +     }
> +
> +     if (da9052->bustype == BUS_SPI)
> +             reg = (reg << 1) | 1;

The same comment I made last time applies now: this isn't something that
should be being handled at the driver level.

For all your I/O functions there's not really any work going on in the
function except the translation from struct da9052 to the regmap it
points to.  May as well just turn the functions into inlines.

> +     if (events == 0)
> +             goto err;
> +
> +     for (i = 0; i < 32; i++) {
> +             if (events & (1 << i))
> +                     handle_nested_irq(da9052->irq_base + i);
> +     }
> +
> +     da9052_group_write(da9052, DA9052_EVENT_A_REG, 4, v);
> +
> +     if (da9052->chip_id == DA9052 || da9052->chip_id == DA9053_AA)
> +             DA9052_FIXME();
> +
> +err:
> +     return IRQ_HANDLED;

If you hit an error you didn't handle an IRQ and so ought to be
returning IRQ_NONE.

_______________________________________________
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev

Reply via email to