[PATCH] gpio: pisosr: remove unneeded direction_output() callback

Bartosz Golaszewski posted 1 patch 3 months, 2 weeks ago
drivers/gpio/gpio-pisosr.c | 8 --------
1 file changed, 8 deletions(-)
[PATCH] gpio: pisosr: remove unneeded direction_output() callback
Posted by Bartosz Golaszewski 3 months, 2 weeks ago
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

GPIO core can handle input-only chips that don't implement the
direction_output() callback at all. There's no need for the driver to
provide a dummy implementation so drop it.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 drivers/gpio/gpio-pisosr.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/gpio/gpio-pisosr.c b/drivers/gpio/gpio-pisosr.c
index e3013e778e15..a69b74866a13 100644
--- a/drivers/gpio/gpio-pisosr.c
+++ b/drivers/gpio/gpio-pisosr.c
@@ -67,13 +67,6 @@ static int pisosr_gpio_direction_input(struct gpio_chip *chip,
 	return 0;
 }
 
-static int pisosr_gpio_direction_output(struct gpio_chip *chip,
-					unsigned offset, int value)
-{
-	/* This device is input only */
-	return -EINVAL;
-}
-
 static int pisosr_gpio_get(struct gpio_chip *chip, unsigned offset)
 {
 	struct pisosr_gpio *gpio = gpiochip_get_data(chip);
@@ -108,7 +101,6 @@ static const struct gpio_chip template_chip = {
 	.owner			= THIS_MODULE,
 	.get_direction		= pisosr_gpio_get_direction,
 	.direction_input	= pisosr_gpio_direction_input,
-	.direction_output	= pisosr_gpio_direction_output,
 	.get			= pisosr_gpio_get,
 	.get_multiple		= pisosr_gpio_get_multiple,
 	.base			= -1,
-- 
2.48.1
Re: [PATCH] gpio: pisosr: remove unneeded direction_output() callback
Posted by Bartosz Golaszewski 3 months, 1 week ago
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>


On Wed, 25 Jun 2025 10:12:22 +0200, Bartosz Golaszewski wrote:
> GPIO core can handle input-only chips that don't implement the
> direction_output() callback at all. There's no need for the driver to
> provide a dummy implementation so drop it.
> 
> 

Applied, thanks!

[1/1] gpio: pisosr: remove unneeded direction_output() callback
      https://git.kernel.org/brgl/linux/c/34e61ba8193945c90f1bcaa9d595fc05c586663d

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>