[PATCH v5 04/13] gpio: mxc: simplify gpio_set_wake_irq

Frank Li Frank.li at oss.nxp.com
Fri Oct 9 11:39:45 PDT 2026


On Sat, Oct 10, 2026 at 02:05:25AM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan at nxp.com>

subject: need () after  gpio_set_wake_irq

gpio: mxc: Use irq_set_irq_wake() to simplify code

>
> Simplify the logic by consolidating into a single irq_set_irq_wake()
> call based on the enable parameter.
>
> Signed-off-by: Peng Fan <peng.fan at nxp.com>
> ---
>  drivers/gpio/gpio-mxc.c | 15 ++++-----------
>  1 file changed, 4 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
> index 29396135717a..c921534aafc2 100644
> --- a/drivers/gpio/gpio-mxc.c
> +++ b/drivers/gpio/gpio-mxc.c
> @@ -325,17 +325,10 @@ static int gpio_set_wake_irq(struct irq_data *d, u32 enable)
>  	u32 gpio_idx = d->hwirq;
>  	int ret;
>
> -	if (enable) {
> -		if (port->irq_high && (gpio_idx >= 16))
> -			ret = enable_irq_wake(port->irq_high);
> -		else
> -			ret = enable_irq_wake(port->irq);
> -	} else {
> -		if (port->irq_high && (gpio_idx >= 16))
> -			ret = disable_irq_wake(port->irq_high);
> -		else
> -			ret = disable_irq_wake(port->irq);
> -	}
> +	if (port->irq_high && (gpio_idx >= 16))
> +		ret = irq_set_irq_wake(port->irq_high, enable);
> +	else
> +		ret = irq_set_irq_wake(port->irq, enable);
>  	if (ret)
>  		return ret;
>
>
> --
> 2.51.0
>
>



More information about the linux-arm-kernel mailing list