mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ARM: orion/gpio: use __assign_bit() where applicable
@ 2026-09-20  2:25 Peng Fan (OSS)
  2026-09-30 19:57 ` Gregory CLEMENT
  0 siblings, 1 reply; 2+ messages in thread
From: Peng Fan (OSS) @ 2026-09-20  2:25 UTC (permalink / raw)
  To: Andrew Lunn, Sebastian Hesselbarth, Gregory Clement, Russell King
  Cc: linux-kernel, Peng Fan, linux-arm-kernel

From: Peng Fan <peng.fan@nxp.com>

Convert open-coded if/else with __set_bit/__clear_bit to the
__assign_bit API.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/plat-orion/gpio.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c
index 49e29b7894a3..a8412dba97f0 100644
--- a/arch/arm/plat-orion/gpio.c
+++ b/arch/arm/plat-orion/gpio.c
@@ -275,15 +275,9 @@ void __init orion_gpio_set_valid(unsigned pin, int mode)
 	if (mode == 1)
 		mode = GPIO_INPUT_OK | GPIO_OUTPUT_OK;
 
-	if (mode & GPIO_INPUT_OK)
-		__set_bit(pin, &ochip->valid_input);
-	else
-		__clear_bit(pin, &ochip->valid_input);
+	__assign_bit(pin, &ochip->valid_input, mode & GPIO_INPUT_OK);
 
-	if (mode & GPIO_OUTPUT_OK)
-		__set_bit(pin, &ochip->valid_output);
-	else
-		__clear_bit(pin, &ochip->valid_output);
+	__assign_bit(pin, &ochip->valid_output, mode & GPIO_OUTPUT_OK);
 }
 
 void orion_gpio_set_blink(unsigned pin, int blink)
-- 
2.51.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ARM: orion/gpio: use __assign_bit() where applicable
  2026-09-20  2:25 [PATCH] ARM: orion/gpio: use __assign_bit() where applicable Peng Fan (OSS)
@ 2026-09-30 19:57 ` Gregory CLEMENT
  0 siblings, 0 replies; 2+ messages in thread
From: Gregory CLEMENT @ 2026-09-30 19:57 UTC (permalink / raw)
  To: Peng Fan (OSS), Andrew Lunn, Sebastian Hesselbarth, Russell King
  Cc: linux-kernel, Peng Fan, linux-arm-kernel

Hello Peng Fan,

> From: Peng Fan <peng.fan@nxp.com>
>
> Convert open-coded if/else with __set_bit/__clear_bit to the
> __assign_bit API.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>

this file is now removed by the series "soc: deprecated platform
removal"
https://lore.kernel.org/all/20260701212353.2196041-1-arnd@kernel.org/

Gregory

> ---
>  arch/arm/plat-orion/gpio.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c
> index 49e29b7894a3..a8412dba97f0 100644
> --- a/arch/arm/plat-orion/gpio.c
> +++ b/arch/arm/plat-orion/gpio.c
> @@ -275,15 +275,9 @@ void __init orion_gpio_set_valid(unsigned pin, int mode)
>  	if (mode == 1)
>  		mode = GPIO_INPUT_OK | GPIO_OUTPUT_OK;
>  
> -	if (mode & GPIO_INPUT_OK)
> -		__set_bit(pin, &ochip->valid_input);
> -	else
> -		__clear_bit(pin, &ochip->valid_input);
> +	__assign_bit(pin, &ochip->valid_input, mode & GPIO_INPUT_OK);
>  
> -	if (mode & GPIO_OUTPUT_OK)
> -		__set_bit(pin, &ochip->valid_output);
> -	else
> -		__clear_bit(pin, &ochip->valid_output);
> +	__assign_bit(pin, &ochip->valid_output, mode & GPIO_OUTPUT_OK);
>  }
>  
>  void orion_gpio_set_blink(unsigned pin, int blink)
> -- 
> 2.51.0
>

-- 
Grégory CLEMENT, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-30 19:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-20  2:25 [PATCH] ARM: orion/gpio: use __assign_bit() where applicable Peng Fan (OSS)
2026-09-30 19:57 ` Gregory CLEMENT

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®