diff options
author | 2025-03-10 13:40:22 +0100 | |
---|---|---|
committer | 2025-03-17 08:27:41 +0100 | |
commit | 19c39c53752ae0b5cbf7577bcdf7c13d1c146e65 (patch) | |
tree | 994efe6fb935c62aba51814f39ec344d2d903ce1 | |
parent | gpio: bt8xx: use lock guards (diff) | |
download | linux-rng-19c39c53752ae0b5cbf7577bcdf7c13d1c146e65.tar.xz linux-rng-19c39c53752ae0b5cbf7577bcdf7c13d1c146e65.zip |
gpio: bt8xx: use new line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.
Link: https://lore.kernel.org/r/20250310-gpiochip-set-conversion-v1-8-03798bb833eb@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-rw-r--r-- | drivers/gpio/gpio-bt8xx.c | 7 |
1 files 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; |