diff mbox series

PM / devfreq: tegra30: Delete an error message in tegra_devfreq_probe()

Message ID ba67e238-43a7-6c53-363e-7a2c12f09949@web.de
State New
Headers show
Series PM / devfreq: tegra30: Delete an error message in tegra_devfreq_probe() | expand

Commit Message

Markus Elfring April 4, 2020, 6:45 p.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 4 Apr 2020 20:34:02 +0200

The function “platform_get_irq” can log an error already.
Thus omit a redundant message for the exception handling in the
calling function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/devfreq/tegra30-devfreq.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--
2.26.0

Comments

Dmitry Osipenko April 4, 2020, 9:40 p.m. UTC | #1
04.04.2020 21:45, Markus Elfring пишет:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 4 Apr 2020 20:34:02 +0200
> 
> The function “platform_get_irq” can log an error already.
> Thus omit a redundant message for the exception handling in the
> calling function.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/devfreq/tegra30-devfreq.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/devfreq/tegra30-devfreq.c b/drivers/devfreq/tegra30-devfreq.c
> index 28b2c7ca416e..93e6f4b25b04 100644
> --- a/drivers/devfreq/tegra30-devfreq.c
> +++ b/drivers/devfreq/tegra30-devfreq.c
> @@ -807,10 +807,9 @@ static int tegra_devfreq_probe(struct platform_device *pdev)
>  	}
> 
>  	err = platform_get_irq(pdev, 0);
> -	if (err < 0) {
> -		dev_err(&pdev->dev, "Failed to get IRQ: %d\n", err);
> +	if (err < 0)
>  		return err;
> -	}
> +
>  	tegra->irq = err;
> 
>  	irq_set_status_flags(tegra->irq, IRQ_NOAUTOEN);
> --
> 2.26.0
> 

Thanks,

Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Markus Elfring April 5, 2020, 6 a.m. UTC | #2
> Reviewed-by: Dmitry Osipenko <digetx@gmail.com>

Thanks for your positive feedback.

Will the logging of error codes need any more clarification
around such function calls?

Regards,
Markus
Dmitry Osipenko April 5, 2020, 1:50 p.m. UTC | #3
05.04.2020 09:00, Markus Elfring пишет:
>> Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
> 
> Thanks for your positive feedback.
> 
> Will the logging of error codes need any more clarification
> around such function calls?

In general no, but it could be different for some (more complex) drivers.
Chanwoo Choi April 6, 2020, midnight UTC | #4
On 4/5/20 3:45 AM, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 4 Apr 2020 20:34:02 +0200
> 
> The function “platform_get_irq” can log an error already.
> Thus omit a redundant message for the exception handling in the
> calling function.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/devfreq/tegra30-devfreq.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/devfreq/tegra30-devfreq.c b/drivers/devfreq/tegra30-devfreq.c
> index 28b2c7ca416e..93e6f4b25b04 100644
> --- a/drivers/devfreq/tegra30-devfreq.c
> +++ b/drivers/devfreq/tegra30-devfreq.c
> @@ -807,10 +807,9 @@ static int tegra_devfreq_probe(struct platform_device *pdev)
>  	}
> 
>  	err = platform_get_irq(pdev, 0);
> -	if (err < 0) {
> -		dev_err(&pdev->dev, "Failed to get IRQ: %d\n", err);
> +	if (err < 0)
>  		return err;
> -	}
> +
>  	tegra->irq = err;
> 
>  	irq_set_status_flags(tegra->irq, IRQ_NOAUTOEN);
> --
> 2.26.0
> 
> 
> 

Applied it. Thanks.
diff mbox series

Patch

diff --git a/drivers/devfreq/tegra30-devfreq.c b/drivers/devfreq/tegra30-devfreq.c
index 28b2c7ca416e..93e6f4b25b04 100644
--- a/drivers/devfreq/tegra30-devfreq.c
+++ b/drivers/devfreq/tegra30-devfreq.c
@@ -807,10 +807,9 @@  static int tegra_devfreq_probe(struct platform_device *pdev)
 	}

 	err = platform_get_irq(pdev, 0);
-	if (err < 0) {
-		dev_err(&pdev->dev, "Failed to get IRQ: %d\n", err);
+	if (err < 0)
 		return err;
-	}
+
 	tegra->irq = err;

 	irq_set_status_flags(tegra->irq, IRQ_NOAUTOEN);