[PATCH] ARM: orion/gpio: use __assign_bit() where applicable

Gregory CLEMENT gregory.clement at bootlin.com
Wed Sep 30 12:57:31 PDT 2026


Hello Peng Fan,

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



More information about the linux-arm-kernel mailing list