soc: fsl: qbman: Remove dev_err() usage after platform_get_irq()
authorStephen Boyd <swboyd@chromium.org>
Tue, 30 Jul 2019 21:36:06 +0000 (14:36 -0700)
committerLi Yang <leoyang.li@nxp.com>
Thu, 15 Aug 2019 21:31:45 +0000 (16:31 -0500)
We don't need dev_err() messages when platform_get_irq() fails now that
platform_get_irq() prints an error message itself when something goes
wrong. Let's remove these prints with a simple semantic patch.

// <smpl>
@@
expression ret;
struct platform_device *E;
@@

ret =
(
platform_get_irq(E, ...)
|
platform_get_irq_byname(E, ...)
);

if ( \( ret < 0 \| ret <= 0 \) )
{
(
-if (ret != -EPROBE_DEFER)
-{ ...
-dev_err(...);
-... }
|
...
-dev_err(...);
)
...
}
// </smpl>

While we're here, remove braces on if statements that only have one
statement (manually).

Cc: Thierry Reding <treding@nvidia.com>
Cc: Li Yang <leoyang.li@nxp.com>
Cc: Simon Horman <horms+renesas@verge.net.au>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
drivers/soc/fsl/qbman/bman_portal.c
drivers/soc/fsl/qbman/qman_portal.c

index cf4f10d6f590082eee2ca43ce8611760ccb00034..e4ef35abb5082964a2f2f2d1befedff0ad8b8c3a 100644 (file)
@@ -135,10 +135,8 @@ static int bman_portal_probe(struct platform_device *pdev)
        pcfg->cpu = -1;
 
        irq = platform_get_irq(pdev, 0);
-       if (irq <= 0) {
-               dev_err(dev, "Can't get %pOF IRQ'\n", node);
+       if (irq <= 0)
                goto err_ioremap1;
-       }
        pcfg->irq = irq;
 
        pcfg->addr_virt_ce = memremap(addr_phys[0]->start,
index e2186b681d87a5abf013622979a72610dae1ea54..991c35a72e008cde4072784c3d1e9c74f7486188 100644 (file)
@@ -275,10 +275,8 @@ static int qman_portal_probe(struct platform_device *pdev)
        pcfg->channel = val;
        pcfg->cpu = -1;
        irq = platform_get_irq(pdev, 0);
-       if (irq <= 0) {
-               dev_err(dev, "Can't get %pOF IRQ\n", node);
+       if (irq <= 0)
                goto err_ioremap1;
-       }
        pcfg->irq = irq;
 
        pcfg->addr_virt_ce = memremap(addr_phys[0]->start,