[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250310-gpiochip-set-conversion-v1-8-03798bb833eb@linaro.org>
Date: Mon, 10 Mar 2025 13:40:22 +0100
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Ray Jui <rjui@...adcom.com>,
Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>,
Florian Fainelli <florian.fainelli@...adcom.com>,
Scott Branden <sbranden@...adcom.com>,
Matti Vaittinen <mazziesaccount@...il.com>,
Marek Vasut <marek.vasut+renesas@...il.com>, Michael Buesch <m@...s.ch>,
Thomas Richard <thomas.richard@...tlin.com>,
Eugeniy Paltsev <Eugeniy.Paltsev@...opsys.com>,
Benson Leung <bleung@...omium.org>, Guenter Roeck <groeck@...omium.org>,
Andy Shevchenko <andy@...nel.org>,
Support Opensource <support.opensource@...semi.com>
Cc: linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-renesas-soc@...r.kernel.org, chrome-platform@...ts.linux.dev,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: [PATCH 08/15] gpio: bt8xx: use new line value setter callbacks
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/gpio/gpio-bt8xx.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/gpio/gpio-bt8xx.c b/drivers/gpio/gpio-bt8xx.c
index 173da7bbfc98..7c9e81fea37a 100644
--- a/drivers/gpio/gpio-bt8xx.c
+++ b/drivers/gpio/gpio-bt8xx.c
@@ -119,8 +119,7 @@ static int bt8xxgpio_gpio_direction_output(struct gpio_chip *gpio,
return 0;
}
-static void bt8xxgpio_gpio_set(struct gpio_chip *gpio,
- unsigned nr, int val)
+static int bt8xxgpio_gpio_set(struct gpio_chip *gpio, unsigned int nr, int val)
{
struct bt8xxgpio *bg = gpiochip_get_data(gpio);
u32 data;
@@ -133,6 +132,8 @@ static void bt8xxgpio_gpio_set(struct gpio_chip *gpio,
else
data &= ~(1 << nr);
bgwrite(data, BT848_GPIO_DATA);
+
+ return 0;
}
static void bt8xxgpio_gpio_setup(struct bt8xxgpio *bg)
@@ -144,7 +145,7 @@ static void bt8xxgpio_gpio_setup(struct bt8xxgpio *bg)
c->direction_input = bt8xxgpio_gpio_direction_input;
c->get = bt8xxgpio_gpio_get;
c->direction_output = bt8xxgpio_gpio_direction_output;
- c->set = bt8xxgpio_gpio_set;
+ c->set_rv = bt8xxgpio_gpio_set;
c->dbg_show = NULL;
c->base = modparam_gpiobase;
c->ngpio = BT8XXGPIO_NR_GPIOS;
--
2.45.2
Powered by blists - more mailing lists