Skip to content

Commit 9e4c444

Browse files
Bartosz GolaszewskiLinus Walleij
authored andcommitted
pinctrl: samsung: 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 <bartosz.golaszewski@linaro.org> Link: https://lore.kernel.org/20250424-gpiochip-set-rv-pinctrl-part2-v1-12-504f91120b99@linaro.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent e52254e commit 9e4c444

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

drivers/pinctrl/samsung/pinctrl-samsung.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -570,22 +570,27 @@ static void samsung_gpio_set_value(struct gpio_chip *gc,
570570
}
571571

572572
/* gpiolib gpio_set callback function */
573-
static void samsung_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
573+
static int samsung_gpio_set(struct gpio_chip *gc, unsigned int offset,
574+
int value)
574575
{
575576
struct samsung_pin_bank *bank = gpiochip_get_data(gc);
576577
struct samsung_pinctrl_drv_data *drvdata = bank->drvdata;
577578
unsigned long flags;
579+
int ret;
578580

579-
if (clk_enable(drvdata->pclk)) {
581+
ret = clk_enable(drvdata->pclk);
582+
if (ret) {
580583
dev_err(drvdata->dev, "failed to enable clock\n");
581-
return;
584+
return ret;
582585
}
583586

584587
raw_spin_lock_irqsave(&bank->slock, flags);
585588
samsung_gpio_set_value(gc, offset, value);
586589
raw_spin_unlock_irqrestore(&bank->slock, flags);
587590

588591
clk_disable(drvdata->pclk);
592+
593+
return 0;
589594
}
590595

591596
/* gpiolib gpio_get callback function */
@@ -1062,7 +1067,7 @@ static int samsung_gpio_set_config(struct gpio_chip *gc, unsigned int offset,
10621067
static const struct gpio_chip samsung_gpiolib_chip = {
10631068
.request = gpiochip_generic_request,
10641069
.free = gpiochip_generic_free,
1065-
.set = samsung_gpio_set,
1070+
.set_rv = samsung_gpio_set,
10661071
.get = samsung_gpio_get,
10671072
.direction_input = samsung_gpio_direction_input,
10681073
.direction_output = samsung_gpio_direction_output,

0 commit comments

Comments
 (0)