Re: [PATCH v2 7/7] media: i2c: max9286: use new GPIO line value setter callbacks

From: Jacopo Mondi
Date: Wed Jun 18 2025 - 08:48:35 EST


Hi Bartosz

On Mon, Jun 16, 2025 at 09:18:56AM +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
>
> struct gpio_chip now has callbacks for setting line values that return
> an integer, allowing to indicate failures. Convert the driver to using
> them.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>

Seems sane, thanks
Reviewed-by: Jacopo Mondi <jacopo.mondi@xxxxxxxxxxxxxxxx>

> ---
> drivers/media/i2c/max9286.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c
> index 9fc4e130a273f8547d7e7ec194cade5b5e9c8df2..1d0b5f56f989874e46f87db4a49d935049e6e7ce 100644
> --- a/drivers/media/i2c/max9286.c
> +++ b/drivers/media/i2c/max9286.c
> @@ -1193,12 +1193,12 @@ static int max9286_gpio_set(struct max9286_priv *priv, unsigned int offset,
> MAX9286_0X0F_RESERVED | priv->gpio_state);
> }
>
> -static void max9286_gpiochip_set(struct gpio_chip *chip,
> - unsigned int offset, int value)
> +static int max9286_gpiochip_set(struct gpio_chip *chip,
> + unsigned int offset, int value)
> {
> struct max9286_priv *priv = gpiochip_get_data(chip);
>
> - max9286_gpio_set(priv, offset, value);
> + return max9286_gpio_set(priv, offset, value);
> }
>
> static int max9286_gpiochip_get(struct gpio_chip *chip, unsigned int offset)
> @@ -1220,7 +1220,7 @@ static int max9286_register_gpio(struct max9286_priv *priv)
> gpio->owner = THIS_MODULE;
> gpio->ngpio = 2;
> gpio->base = -1;
> - gpio->set = max9286_gpiochip_set;
> + gpio->set_rv = max9286_gpiochip_set;
> gpio->get = max9286_gpiochip_get;
> gpio->can_sleep = true;
>
>
> --
> 2.48.1
>