]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: i2c: max9286: use new GPIO line value setter callbacks
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 16 Jun 2025 07:18:56 +0000 (09:18 +0200)
committerHans Verkuil <hverkuil@xs4all.nl>
Tue, 17 Jun 2025 08:35:13 +0000 (10:35 +0200)
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@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/i2c/max9286.c

index 9fc4e130a273f8547d7e7ec194cade5b5e9c8df2..1d0b5f56f989874e46f87db4a49d935049e6e7ce 100644 (file)
@@ -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;