Re: [PATCH v6 1/5] gpio: pca953x: code shrink

From: Linus Walleij
Date: Mon Sep 12 2016 - 08:46:13 EST


On Fri, Sep 9, 2016 at 11:17 AM, Bartosz Golaszewski
<bgolaszewski@xxxxxxxxxxxx> wrote:

> There are multiple places in the driver code where a
> switch (chip->chip_type) is used to determine the proper register
> offset.
>
> Unduplicate the code by adding a simple structure holding the possible
> offsets that differ between the pca953x and pca957x chip families and
> use it to avoid the checks.
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@xxxxxxxxxxxx>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

Patch applied.

Yours,
Linus Walleij