mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 02:24:24 +02:00
gpio: dln2: 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-1-78399683ca38@linaro.org Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
This commit is contained in:
parent
df9b3454a0
commit
afb4aed832
|
|
@ -220,11 +220,12 @@ static int dln2_gpio_get(struct gpio_chip *chip, unsigned int offset)
|
|||
return dln2_gpio_pin_get_out_val(dln2, offset);
|
||||
}
|
||||
|
||||
static void dln2_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
|
||||
static int dln2_gpio_set(struct gpio_chip *chip, unsigned int offset,
|
||||
int value)
|
||||
{
|
||||
struct dln2_gpio *dln2 = gpiochip_get_data(chip);
|
||||
|
||||
dln2_gpio_pin_set_out_val(dln2, offset, value);
|
||||
return dln2_gpio_pin_set_out_val(dln2, offset, value);
|
||||
}
|
||||
|
||||
static int dln2_gpio_set_direction(struct gpio_chip *chip, unsigned offset,
|
||||
|
|
@ -468,7 +469,7 @@ static int dln2_gpio_probe(struct platform_device *pdev)
|
|||
dln2->gpio.base = -1;
|
||||
dln2->gpio.ngpio = pins;
|
||||
dln2->gpio.can_sleep = true;
|
||||
dln2->gpio.set = dln2_gpio_set;
|
||||
dln2->gpio.set_rv = dln2_gpio_set;
|
||||
dln2->gpio.get = dln2_gpio_get;
|
||||
dln2->gpio.request = dln2_gpio_request;
|
||||
dln2->gpio.free = dln2_gpio_free;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user