Re: [PATCH] iio: adc: ad4170: use lookup table for gpio mask selection

From: Marcelo Schmitt

Date: Sun Apr 12 2026 - 09:51:46 EST


On 04/05, 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.
>
> Signed-off-by: Guilherme Ivo Bozi <guilherme.bozi@xxxxxx>

Acked-by: Marcelo Schmitt <marcelo.schmitt1@xxxxxxxxx>