mtd: rawnand: cadence: Remove dev_err() on platform_get_irq() failure
authorYueHaibing <yuehaibing@huawei.com>
Wed, 23 Oct 2019 13:57:10 +0000 (21:57 +0800)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 29 Oct 2019 13:42:12 +0000 (14:42 +0100)
platform_get_irq() will call dev_err() itself on failure,
so there is no need for the driver to also do this.
This is detected by coccinelle.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/cadence-nand-controller.c

index 91dabff..28a0426 100644 (file)
@@ -2961,10 +2961,9 @@ static int cadence_nand_dt_probe(struct platform_device *ofdev)
 
        cdns_ctrl->dev = &ofdev->dev;
        cdns_ctrl->irq = platform_get_irq(ofdev, 0);
-       if (cdns_ctrl->irq < 0) {
-               dev_err(&ofdev->dev, "no irq defined\n");
+       if (cdns_ctrl->irq < 0)
                return cdns_ctrl->irq;
-       }
+
        dev_info(cdns_ctrl->dev, "IRQ: nr %d\n", cdns_ctrl->irq);
 
        cdns_ctrl->reg = devm_platform_ioremap_resource(ofdev, 0);