Skip to content

Commit 6314954

Browse files
Bartosz Golaszewskilinusw
authored andcommitted
pinctrl: ma35: 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. Signed-off-by: Bartosz Golaszewski <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent cc43eea commit 6314954

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/pinctrl/nuvoton/pinctrl-ma35.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ static int ma35_gpio_core_get(struct gpio_chip *gc, unsigned int gpio)
361361
return !!(readl(reg_pin) & BIT(gpio));
362362
}
363363

364-
static void ma35_gpio_core_set(struct gpio_chip *gc, unsigned int gpio, int val)
364+
static int ma35_gpio_core_set(struct gpio_chip *gc, unsigned int gpio, int val)
365365
{
366366
struct ma35_pin_bank *bank = gpiochip_get_data(gc);
367367
void __iomem *reg_dout = bank->reg_base + MA35_GP_REG_DOUT;
@@ -373,6 +373,8 @@ static void ma35_gpio_core_set(struct gpio_chip *gc, unsigned int gpio, int val)
373373
regval = readl(reg_dout) & ~BIT(gpio);
374374

375375
writel(regval, reg_dout);
376+
377+
return 0;
376378
}
377379

378380
static int ma35_gpio_core_to_request(struct gpio_chip *gc, unsigned int gpio)
@@ -524,7 +526,7 @@ static int ma35_gpiolib_register(struct platform_device *pdev, struct ma35_pinct
524526
bank->chip.direction_input = ma35_gpio_core_direction_in;
525527
bank->chip.direction_output = ma35_gpio_core_direction_out;
526528
bank->chip.get = ma35_gpio_core_get;
527-
bank->chip.set = ma35_gpio_core_set;
529+
bank->chip.set_rv = ma35_gpio_core_set;
528530
bank->chip.base = -1;
529531
bank->chip.ngpio = bank->nr_pins;
530532
bank->chip.can_sleep = false;

0 commit comments

Comments
 (0)