[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2583871.PYKUYFuaPT@fw-rgant>
Date: Thu, 17 Jul 2025 17:32:25 +0200
From: Romain Gantois <romain.gantois@...tlin.com>
To: Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Linus Walleij <linus.walleij@...aro.org>, Bartosz Golaszewski <brgl@...ev.pl>
Cc: linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject:
Re: [PATCH 2/2] misc: ti-fpc202: use new GPIO line value setter callbacks
On Thursday, 17 July 2025 15:03:56 CEST Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
>
> 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@...aro.org>
> ---
> drivers/misc/ti_fpc202.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/misc/ti_fpc202.c b/drivers/misc/ti_fpc202.c
> index ca415ef45cbe..f84cae50e2c9 100644
> --- a/drivers/misc/ti_fpc202.c
> +++ b/drivers/misc/ti_fpc202.c
> @@ -118,8 +118,8 @@ static void fpc202_set_enable(struct fpc202_priv *priv,
> int enable) gpiod_set_value(priv->en_gpio, enable);
> }
>
> -static void fpc202_gpio_set(struct gpio_chip *chip, unsigned int offset,
> - int value)
> +static int fpc202_gpio_set(struct gpio_chip *chip, unsigned int offset,
> + int value)
> {
> struct fpc202_priv *priv = gpiochip_get_data(chip);
> int ret;
> @@ -128,7 +128,7 @@ static void fpc202_gpio_set(struct gpio_chip *chip,
> unsigned int offset, ret = fpc202_read(priv, FPC202_REG_OUT_A_OUT_B_VAL);
> if (ret < 0) {
> dev_err(&priv->client->dev, "Failed to set GPIO %d value! err
%d\n",
> offset, ret); - return;
> + return ret;
> }
>
> val = (u8)ret;
> @@ -138,7 +138,7 @@ static void fpc202_gpio_set(struct gpio_chip *chip,
> unsigned int offset, else
> val &= ~BIT(offset - FPC202_GPIO_P0_S0_OUT_A);
>
> - fpc202_write(priv, FPC202_REG_OUT_A_OUT_B_VAL, val);
> + return fpc202_write(priv, FPC202_REG_OUT_A_OUT_B_VAL, val);
> }
>
> static int fpc202_gpio_get(struct gpio_chip *chip, unsigned int offset)
> @@ -333,7 +333,7 @@ static int fpc202_probe(struct i2c_client *client)
> priv->gpio.base = -1;
> priv->gpio.direction_input = fpc202_gpio_direction_input;
> priv->gpio.direction_output = fpc202_gpio_direction_output;
> - priv->gpio.set = fpc202_gpio_set;
> + priv->gpio.set_rv = fpc202_gpio_set;
> priv->gpio.get = fpc202_gpio_get;
> priv->gpio.ngpio = FPC202_GPIO_COUNT;
> priv->gpio.parent = dev;
Reviewed-by: Romain Gantois <romain.gantois@...tlin.com>
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists