diff mbox series

ARM: pxa: ssp: Delete an error message in pxa_ssp_probe()

Message ID 524ae90a-a7cb-feee-6107-743c52c2b1e4@web.de (mailing list archive)
State New, archived
Headers show
Series ARM: pxa: ssp: Delete an error message in pxa_ssp_probe() | expand

Commit Message

Markus Elfring April 4, 2020, 2 p.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 4 Apr 2020 15:50:10 +0200
Subject: [PATCH] ARM: pxa: ssp: Delete an error message in pxa_ssp_probe()

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>
---
 arch/arm/plat-pxa/ssp.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--
2.26.0

Comments

Andy Shevchenko April 4, 2020, 3:17 p.m. UTC | #1
On Sat, Apr 4, 2020 at 5:03 PM Markus Elfring <Markus.Elfring@web.de> wrote:
>
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 4 Apr 2020 15:50:10 +0200
> Subject: [PATCH] ARM: pxa: ssp: Delete an error message in pxa_ssp_probe()
>
> The function “platform_get_irq” can log an error already.
> Thus omit a redundant message for the exception handling in the
> calling function.

...

>         ssp->irq = platform_get_irq(pdev, 0);
> -       if (ssp->irq < 0) {
> -               dev_err(dev, "no IRQ resource defined\n");
> +       if (ssp->irq < 0)
>                 return -ENODEV;
> -       }

At the same time we can unshadow the error code, i.e.
  return ssp->irq;
Markus Elfring April 4, 2020, 4:01 p.m. UTC | #2
>>         ssp->irq = platform_get_irq(pdev, 0);
>> -       if (ssp->irq < 0) {
>> -               dev_err(dev, "no IRQ resource defined\n");
>> +       if (ssp->irq < 0)
>>                 return -ENODEV;
>> -       }
>
> At the same time we can unshadow the error code, i.e.
>   return ssp->irq;

Have you got any preferences for the order of possible change combinations?

Regards,
Markus
diff mbox series

Patch

diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c
index 563440315acd..9e77b3392c1e 100644
--- a/arch/arm/plat-pxa/ssp.c
+++ b/arch/arm/plat-pxa/ssp.c
@@ -146,10 +146,8 @@  static int pxa_ssp_probe(struct platform_device *pdev)
 	}

 	ssp->irq = platform_get_irq(pdev, 0);
-	if (ssp->irq < 0) {
-		dev_err(dev, "no IRQ resource defined\n");
+	if (ssp->irq < 0)
 		return -ENODEV;
-	}

 	if (dev->of_node) {
 		const struct of_device_id *id =