Skip to content

Commit c84c4a1

Browse files
Bartosz GolaszewskiLinus Walleij
authored andcommitted
pinctrl: bcm: nsp-gpio: 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/20250425-gpiochip-set-rv-pinctrl-bcm-v1-1-6b8883d79b66@linaro.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 23a5fa3 commit c84c4a1

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/pinctrl/bcm/pinctrl-nsp-gpio.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ static int nsp_gpio_get_direction(struct gpio_chip *gc, unsigned gpio)
310310
return !val;
311311
}
312312

313-
static void nsp_gpio_set(struct gpio_chip *gc, unsigned gpio, int val)
313+
static int nsp_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
314314
{
315315
struct nsp_gpio *chip = gpiochip_get_data(gc);
316316
unsigned long flags;
@@ -320,6 +320,8 @@ static void nsp_gpio_set(struct gpio_chip *gc, unsigned gpio, int val)
320320
raw_spin_unlock_irqrestore(&chip->lock, flags);
321321

322322
dev_dbg(chip->dev, "gpio:%u set, value:%d\n", gpio, val);
323+
324+
return 0;
323325
}
324326

325327
static int nsp_gpio_get(struct gpio_chip *gc, unsigned gpio)
@@ -654,7 +656,7 @@ static int nsp_gpio_probe(struct platform_device *pdev)
654656
gc->direction_input = nsp_gpio_direction_input;
655657
gc->direction_output = nsp_gpio_direction_output;
656658
gc->get_direction = nsp_gpio_get_direction;
657-
gc->set = nsp_gpio_set;
659+
gc->set_rv = nsp_gpio_set;
658660
gc->get = nsp_gpio_get;
659661

660662
/* optional GPIO interrupt support */

0 commit comments

Comments
 (0)