mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 03:24:19 +02:00
gpio: zevio: use new GPIO 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/20250709-gpiochip-set-rv-gpio-remaining-v1-16-b8950f69618d@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
parent
383a02f6d4
commit
ee6e05eb5f
|
|
@ -91,7 +91,7 @@ static int zevio_gpio_get(struct gpio_chip *chip, unsigned pin)
|
|||
return (val >> ZEVIO_GPIO_BIT(pin)) & 0x1;
|
||||
}
|
||||
|
||||
static void zevio_gpio_set(struct gpio_chip *chip, unsigned pin, int value)
|
||||
static int zevio_gpio_set(struct gpio_chip *chip, unsigned int pin, int value)
|
||||
{
|
||||
struct zevio_gpio *controller = gpiochip_get_data(chip);
|
||||
u32 val;
|
||||
|
|
@ -105,6 +105,8 @@ static void zevio_gpio_set(struct gpio_chip *chip, unsigned pin, int value)
|
|||
|
||||
zevio_gpio_port_set(controller, pin, ZEVIO_GPIO_OUTPUT, val);
|
||||
spin_unlock(&controller->lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int zevio_gpio_direction_input(struct gpio_chip *chip, unsigned pin)
|
||||
|
|
@ -159,7 +161,7 @@ static int zevio_gpio_to_irq(struct gpio_chip *chip, unsigned pin)
|
|||
static const struct gpio_chip zevio_gpio_chip = {
|
||||
.direction_input = zevio_gpio_direction_input,
|
||||
.direction_output = zevio_gpio_direction_output,
|
||||
.set = zevio_gpio_set,
|
||||
.set_rv = zevio_gpio_set,
|
||||
.get = zevio_gpio_get,
|
||||
.to_irq = zevio_gpio_to_irq,
|
||||
.base = 0,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user