[PATCH] m68k: coldfire: gpio: use new line value setter callbacks

Bartosz Golaszewski posted 1 patch 8 months, 1 week ago
arch/m68k/coldfire/gpio.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
[PATCH] m68k: coldfire: gpio: use new line value setter callbacks
Posted by Bartosz Golaszewski 8 months, 1 week ago
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

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>
---
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. We're in the process of
converting all GPIO drivers to using the new API. This series converts
all m68k board-file level controllers.
---
 arch/m68k/coldfire/gpio.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/m68k/coldfire/gpio.c b/arch/m68k/coldfire/gpio.c
index ca26de257871..30e5a4ed799d 100644
--- a/arch/m68k/coldfire/gpio.c
+++ b/arch/m68k/coldfire/gpio.c
@@ -123,10 +123,12 @@ static int mcfgpio_direction_output(struct gpio_chip *chip, unsigned offset,
 	return __mcfgpio_direction_output(offset, value);
 }
 
-static void mcfgpio_set_value(struct gpio_chip *chip, unsigned offset,
-			      int value)
+static int mcfgpio_set_value(struct gpio_chip *chip, unsigned int offset,
+			     int value)
 {
 	__mcfgpio_set_value(offset, value);
+
+	return 0;
 }
 
 static int mcfgpio_request(struct gpio_chip *chip, unsigned offset)
@@ -158,7 +160,7 @@ static struct gpio_chip mcfgpio_chip = {
 	.direction_input	= mcfgpio_direction_input,
 	.direction_output	= mcfgpio_direction_output,
 	.get			= mcfgpio_get_value,
-	.set			= mcfgpio_set_value,
+	.set_rv			= mcfgpio_set_value,
 	.to_irq			= mcfgpio_to_irq,
 	.base			= 0,
 	.ngpio			= MCFGPIO_PIN_MAX,

---
base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8
change-id: 20250326-gpiochip-set-rv-m68k-789f77283f78

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Re: [PATCH] m68k: coldfire: gpio: use new line value setter callbacks
Posted by Greg Ungerer 8 months ago
Hi Bartosz,

On 7/4/25 17:20, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> 
> 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>

Thanks. Applied to m68knommu git tree for-next branch, with
Linus Walleij's reviewed by.

Regards
Greg


> ---
> struct gpio_chip now has callbacks for setting line values that return
> an integer, allowing to indicate failures. We're in the process of
> converting all GPIO drivers to using the new API. This series converts
> all m68k board-file level controllers.
> ---
>   arch/m68k/coldfire/gpio.c | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/m68k/coldfire/gpio.c b/arch/m68k/coldfire/gpio.c
> index ca26de257871..30e5a4ed799d 100644
> --- a/arch/m68k/coldfire/gpio.c
> +++ b/arch/m68k/coldfire/gpio.c
> @@ -123,10 +123,12 @@ static int mcfgpio_direction_output(struct gpio_chip *chip, unsigned offset,
>   	return __mcfgpio_direction_output(offset, value);
>   }
>   
> -static void mcfgpio_set_value(struct gpio_chip *chip, unsigned offset,
> -			      int value)
> +static int mcfgpio_set_value(struct gpio_chip *chip, unsigned int offset,
> +			     int value)
>   {
>   	__mcfgpio_set_value(offset, value);
> +
> +	return 0;
>   }
>   
>   static int mcfgpio_request(struct gpio_chip *chip, unsigned offset)
> @@ -158,7 +160,7 @@ static struct gpio_chip mcfgpio_chip = {
>   	.direction_input	= mcfgpio_direction_input,
>   	.direction_output	= mcfgpio_direction_output,
>   	.get			= mcfgpio_get_value,
> -	.set			= mcfgpio_set_value,
> +	.set_rv			= mcfgpio_set_value,
>   	.to_irq			= mcfgpio_to_irq,
>   	.base			= 0,
>   	.ngpio			= MCFGPIO_PIN_MAX,
> 
> ---
> base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8
> change-id: 20250326-gpiochip-set-rv-m68k-789f77283f78
> 
> Best regards,
Re: [PATCH] m68k: coldfire: gpio: use new line value setter callbacks
Posted by Linus Walleij 8 months ago
On Mon, Apr 7, 2025 at 9:20 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:

> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> 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>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij