diff options
author | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2025-04-07 09:13:12 +0200 |
---|---|---|
committer | Bartosz Golaszewski <brgl@bgdev.pl> | 2025-04-16 17:52:43 +0200 |
commit | 097cf61ba5bd69328a69c4920f3454089fae0a43 (patch) | |
tree | 2614869e08183b20a74d590b708aeb35f46bf0ed | |
parent | 21d3c6531b113b1aaecd99ae90dddd55c20f372b (diff) |
gpio: em: 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.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20250407-gpiochip-set-rv-gpio-part1-v1-3-78399683ca38@linaro.org
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
-rw-r--r-- | drivers/gpio/gpio-em.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c index 6c862c572322..857c28895131 100644 --- a/drivers/gpio/gpio-em.c +++ b/drivers/gpio/gpio-em.c @@ -204,13 +204,15 @@ static void __em_gio_set(struct gpio_chip *chip, unsigned int reg, (BIT(shift + 16)) | (value << shift)); } -static void em_gio_set(struct gpio_chip *chip, unsigned offset, int value) +static int em_gio_set(struct gpio_chip *chip, unsigned int offset, int value) { /* output is split into two registers */ if (offset < 16) __em_gio_set(chip, GIO_OL, offset, value); else __em_gio_set(chip, GIO_OH, offset - 16, value); + + return 0; } static int em_gio_direction_output(struct gpio_chip *chip, unsigned offset, @@ -304,7 +306,7 @@ static int em_gio_probe(struct platform_device *pdev) gpio_chip->direction_input = em_gio_direction_input; gpio_chip->get = em_gio_get; gpio_chip->direction_output = em_gio_direction_output; - gpio_chip->set = em_gio_set; + gpio_chip->set_rv = em_gio_set; gpio_chip->to_irq = em_gio_to_irq; gpio_chip->request = pinctrl_gpio_request; gpio_chip->free = em_gio_free; |