spi: xcomm: use new GPIO line value setter callbacks
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 8 Apr 2025 07:39:56 +0000 (09:39 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 8 Apr 2025 11:16:10 +0000 (12:16 +0100)
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>
Link: https://patch.msgid.link/20250408-gpiochip-set-rv-spi-v1-1-597660766654@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-xcomm.c

index 3bd0149d8f4eaeb0abcb29b815420c8e7f2c9c82..1a40c4866ce1734ec90c9720a1ec1a58156ec2cc 100644 (file)
@@ -44,8 +44,8 @@ struct spi_xcomm {
        u8 buf[63];
 };
 
-static void spi_xcomm_gpio_set_value(struct gpio_chip *chip,
-                                    unsigned int offset, int val)
+static int spi_xcomm_gpio_set_value(struct gpio_chip *chip,
+                                   unsigned int offset, int val)
 {
        struct spi_xcomm *spi_xcomm = gpiochip_get_data(chip);
        unsigned char buf[2];
@@ -53,7 +53,7 @@ static void spi_xcomm_gpio_set_value(struct gpio_chip *chip,
        buf[0] = SPI_XCOMM_CMD_GPIO_SET;
        buf[1] = !!val;
 
-       i2c_master_send(spi_xcomm->i2c, buf, 2);
+       return i2c_master_send(spi_xcomm->i2c, buf, 2);
 }
 
 static int spi_xcomm_gpio_get_direction(struct gpio_chip *chip,
@@ -70,7 +70,7 @@ static int spi_xcomm_gpio_add(struct spi_xcomm *spi_xcomm)
                return 0;
 
        spi_xcomm->gc.get_direction = spi_xcomm_gpio_get_direction;
-       spi_xcomm->gc.set = spi_xcomm_gpio_set_value;
+       spi_xcomm->gc.set_rv = spi_xcomm_gpio_set_value;
        spi_xcomm->gc.can_sleep = 1;
        spi_xcomm->gc.base = -1;
        spi_xcomm->gc.ngpio = 1;