Re: [PATCH] iio: adc: ad4170: use lookup table for gpio mask selection
From: Jonathan Cameron
Date: Mon Apr 20 2026 - 14:39:09 EST
On Mon, 6 Apr 2026 22:50:53 +0300
Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:
> On Sun, Apr 05, 2026 at 06:37:26PM -0300, Guilherme Ivo Bozi wrote:
> > Both ad4170_gpio_direction_input() and
> > ad4170_gpio_direction_output() duplicate the same switch
> > statement to map a GPIO offset to its corresponding mask.
> >
> > Replace the switch with a static lookup table, simplifying the code
> > and avoiding duplication. This also makes future extensions easier.
> >
> > No functional change intended.
>
> If this churn is okay by maintainers,
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
>
Applied.
Thanks,
J