[PATCH] gpio: Remove redundant dev_err()/dev_err_probe()

Andy Shevchenko andriy.shevchenko at intel.com
Fri Jul 17 03:23:32 PDT 2026


On Fri, Jul 17, 2026 at 04:30:33PM +0800, Pan Chuang wrote:
> Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in
> devm_request_*_irq()"), devm_request_irq() and devm_request_threaded_irq()
> automatically log detailed error messages on failure. Remove the
> now-redundant driver-specific dev_err() and dev_err_probe() calls.


...

> -	if (err != 0) {
> -		dev_err(chip->parent, "can't request IRQ#%d: %d\n",
> -			adnp->client->irq, err);
> +	if (err != 0)

This style is discouraged, so while at it, please replace with

	if (err)

>  		return err;
> -	}
>  
>  	return 0;

...

> +++ b/drivers/gpio/gpio-brcmstb.c
> @@ -489,10 +489,8 @@ static int brcmstb_gpio_irq_setup(struct platform_device *pdev,
>  					       IRQF_SHARED,
>  					       "brcmstb-gpio-wake", priv);
>  
> -			if (err < 0) {
> -				dev_err(dev, "Couldn't request wake IRQ");
> +			if (err < 0)

This style might be okay, but has no sense, we know that there is no positive
out from this function, so, please also replace with

			if (err)

>  				goto out_free_domain;
> -			}
>  		}
>  		priv->irq_chip.irq_set_wake = brcmstb_gpio_irq_set_wake;
>  	}

...

> +++ b/drivers/gpio/gpio-max77620.c
> @@ -356,10 +356,8 @@ static int max77620_gpio_probe(struct platform_device *pdev)
>  	ret = devm_request_threaded_irq(&pdev->dev, gpio_irq, NULL,
>  					max77620_gpio_irqhandler, IRQF_ONESHOT,
>  					"max77620-gpio", mgpio);
> -	if (ret < 0) {
> -		dev_err(&pdev->dev, "failed to request IRQ: %d\n", ret);
> +	if (ret < 0)
>  		return ret;
> -	}

Ditto. And so on...

-- 
With Best Regards,
Andy Shevchenko





More information about the linux-riscv mailing list