mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 19:43:40 +02:00
gpio: graniterapids: 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-7-78399683ca38@linaro.org Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
This commit is contained in:
parent
8bf15cf9f9
commit
96af713382
|
|
@ -116,7 +116,7 @@ static int gnr_gpio_get(struct gpio_chip *gc, unsigned int gpio)
|
|||
return !!(dw & GNR_CFG_DW_RXSTATE);
|
||||
}
|
||||
|
||||
static void gnr_gpio_set(struct gpio_chip *gc, unsigned int gpio, int value)
|
||||
static int gnr_gpio_set(struct gpio_chip *gc, unsigned int gpio, int value)
|
||||
{
|
||||
u32 clear = 0;
|
||||
u32 set = 0;
|
||||
|
|
@ -126,7 +126,7 @@ static void gnr_gpio_set(struct gpio_chip *gc, unsigned int gpio, int value)
|
|||
else
|
||||
clear = GNR_CFG_DW_TXSTATE;
|
||||
|
||||
gnr_gpio_configure_line(gc, gpio, clear, set);
|
||||
return gnr_gpio_configure_line(gc, gpio, clear, set);
|
||||
}
|
||||
|
||||
static int gnr_gpio_get_direction(struct gpio_chip *gc, unsigned int gpio)
|
||||
|
|
@ -159,7 +159,7 @@ static const struct gpio_chip gnr_gpio_chip = {
|
|||
.owner = THIS_MODULE,
|
||||
.request = gnr_gpio_request,
|
||||
.get = gnr_gpio_get,
|
||||
.set = gnr_gpio_set,
|
||||
.set_rv = gnr_gpio_set,
|
||||
.get_direction = gnr_gpio_get_direction,
|
||||
.direction_input = gnr_gpio_direction_input,
|
||||
.direction_output = gnr_gpio_direction_output,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user