diff mbox series

[-next,v2] gpio: davinci: Remove redundant dev_err_probe()

Message ID 20230727115726.2666041-1-ruanjinjie@huawei.com
State Accepted
Commit 73561d281631630748fd94bca120a79076b52266
Headers show
Series [-next,v2] gpio: davinci: Remove redundant dev_err_probe() | expand

Commit Message

Jinjie Ruan July 27, 2023, 11:57 a.m. UTC
There is no need to call the dev_err_probe() function directly to print
a custom message when handling an error from platform_get_irq() function as
it is going to display an appropriate error message in case of a failure.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
---
v2:
- split into 2 patches on per-driver basis
---
 drivers/gpio/gpio-davinci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bartosz Golaszewski July 29, 2023, 1:58 p.m. UTC | #1
On Thu, Jul 27, 2023 at 1:58 PM Ruan Jinjie <ruanjinjie@huawei.com> wrote:
>
> There is no need to call the dev_err_probe() function directly to print
> a custom message when handling an error from platform_get_irq() function as
> it is going to display an appropriate error message in case of a failure.
>
> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
> Reviewed-by: Andy Shevchenko <andy@kernel.org>
> ---
> v2:
> - split into 2 patches on per-driver basis
> ---
>  drivers/gpio/gpio-davinci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
> index fff510d86e31..8db5717bdabe 100644
> --- a/drivers/gpio/gpio-davinci.c
> +++ b/drivers/gpio/gpio-davinci.c
> @@ -236,7 +236,7 @@ static int davinci_gpio_probe(struct platform_device *pdev)
>         for (i = 0; i < nirq; i++) {
>                 chips->irqs[i] = platform_get_irq(pdev, i);
>                 if (chips->irqs[i] < 0)
> -                       return dev_err_probe(dev, chips->irqs[i], "IRQ not populated\n");
> +                       return chips->irqs[i];
>         }
>
>         chips->chip.label = dev_name(dev);
> --
> 2.34.1
>

Applied, thanks!

Bartosz
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
index fff510d86e31..8db5717bdabe 100644
--- a/drivers/gpio/gpio-davinci.c
+++ b/drivers/gpio/gpio-davinci.c
@@ -236,7 +236,7 @@  static int davinci_gpio_probe(struct platform_device *pdev)
 	for (i = 0; i < nirq; i++) {
 		chips->irqs[i] = platform_get_irq(pdev, i);
 		if (chips->irqs[i] < 0)
-			return dev_err_probe(dev, chips->irqs[i], "IRQ not populated\n");
+			return chips->irqs[i];
 	}
 
 	chips->chip.label = dev_name(dev);