]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
rtc: Remove dev_err() usage after platform_get_irq()
authorStephen Boyd <swboyd@chromium.org>
Tue, 30 Jul 2019 18:15:39 +0000 (11:15 -0700)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 13 Aug 2019 08:53:10 +0000 (10:53 +0200)
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: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: linux-rtc@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20190730181557.90391-40-swboyd@chromium.org
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
27 files changed:
drivers/rtc/rtc-88pm80x.c
drivers/rtc/rtc-88pm860x.c
drivers/rtc/rtc-ac100.c
drivers/rtc/rtc-armada38x.c
drivers/rtc/rtc-asm9260.c
drivers/rtc/rtc-at91rm9200.c
drivers/rtc/rtc-at91sam9.c
drivers/rtc/rtc-bd70528.c
drivers/rtc/rtc-davinci.c
drivers/rtc/rtc-jz4740.c
drivers/rtc/rtc-max77686.c
drivers/rtc/rtc-mt7622.c
drivers/rtc/rtc-pic32.c
drivers/rtc/rtc-pm8xxx.c
drivers/rtc/rtc-puv3.c
drivers/rtc/rtc-pxa.c
drivers/rtc/rtc-rk808.c
drivers/rtc/rtc-s3c.c
drivers/rtc/rtc-sc27xx.c
drivers/rtc/rtc-spear.c
drivers/rtc/rtc-stm32.c
drivers/rtc/rtc-sun6i.c
drivers/rtc/rtc-sunxi.c
drivers/rtc/rtc-tegra.c
drivers/rtc/rtc-vt8500.c
drivers/rtc/rtc-xgene.c
drivers/rtc/rtc-zynqmp.c

index e4d5a19fd1c906b261af06e753d26d2ef85ec372..9aa4a59dbf47fa5be38844dfc339b5ba872b304d 100644 (file)
@@ -264,7 +264,6 @@ static int pm80x_rtc_probe(struct platform_device *pdev)
                return -ENOMEM;
        info->irq = platform_get_irq(pdev, 0);
        if (info->irq < 0) {
-               dev_err(&pdev->dev, "No IRQ resource!\n");
                ret = -EINVAL;
                goto out;
        }
index 434285f495e02f8f9946d6d28094639ddb2e8540..4743b16a8d849e3a5417b40e59fe8f2889651d2e 100644 (file)
@@ -328,10 +328,8 @@ static int pm860x_rtc_probe(struct platform_device *pdev)
        if (!info)
                return -ENOMEM;
        info->irq = platform_get_irq(pdev, 0);
-       if (info->irq < 0) {
-               dev_err(&pdev->dev, "No IRQ resource!\n");
+       if (info->irq < 0)
                return info->irq;
-       }
 
        info->chip = chip;
        info->i2c = (chip->id == CHIP_PM8607) ? chip->client : chip->companion;
index 2e5a8b15b222290469552e874df924d7e7a0399b..a4dcf29503965db6a7415da3529c0c3a1c63bd24 100644 (file)
@@ -578,10 +578,8 @@ static int ac100_rtc_probe(struct platform_device *pdev)
        chip->regmap = ac100->regmap;
 
        chip->irq = platform_get_irq(pdev, 0);
-       if (chip->irq < 0) {
-               dev_err(&pdev->dev, "No IRQ resource\n");
+       if (chip->irq < 0)
                return chip->irq;
-       }
 
        chip->rtc = devm_rtc_allocate_device(&pdev->dev);
        if (IS_ERR(chip->rtc))
index 19d6980e90fb84eae4b5c24a0ed9847d9662d549..8e8b8079b60a7fd14b221f62b6360774930d0ab7 100644 (file)
@@ -530,11 +530,8 @@ static __init int armada38x_rtc_probe(struct platform_device *pdev)
                return PTR_ERR(rtc->regs_soc);
 
        rtc->irq = platform_get_irq(pdev, 0);
-
-       if (rtc->irq < 0) {
-               dev_err(&pdev->dev, "no irq\n");
+       if (rtc->irq < 0)
                return rtc->irq;
-       }
 
        rtc->rtc_dev = devm_rtc_allocate_device(&pdev->dev);
        if (IS_ERR(rtc->rtc_dev))
index d45a44936308094908e658be825729f19df3b9bd..10413d803caade8977a14d8537fbbf9c0ebfcddb 100644 (file)
@@ -257,10 +257,8 @@ static int asm9260_rtc_probe(struct platform_device *pdev)
        platform_set_drvdata(pdev, priv);
 
        irq_alarm = platform_get_irq(pdev, 0);
-       if (irq_alarm < 0) {
-               dev_err(dev, "No alarm IRQ resource defined\n");
+       if (irq_alarm < 0)
                return irq_alarm;
-       }
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        priv->iobase = devm_ioremap_resource(dev, res);
index 82a54e93ff04af0ed75237fa476da828d762e6ba..d119c6e6353e7fafca53808aa9b2f4da87686781 100644 (file)
@@ -378,10 +378,8 @@ static int __init at91_rtc_probe(struct platform_device *pdev)
        }
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "no irq resource defined\n");
+       if (irq < 0)
                return -ENXIO;
-       }
 
        at91_rtc_regs = devm_ioremap(&pdev->dev, regs->start,
                                     resource_size(regs));
index 4daf3789b97874f061c48e2e4c6118cb99c9d040..bb3ba7bfe6a575e762e97293d25758e331ed7451 100644 (file)
@@ -342,10 +342,8 @@ static int at91_rtc_probe(struct platform_device *pdev)
        struct of_phandle_args args;
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "failed to get interrupt resource\n");
+       if (irq < 0)
                return irq;
-       }
 
        rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL);
        if (!rtc)
index f9bdd555e1a2c61ecfc600ddd03a482fd77fe3f3..3e745c05bc22a23553f6bcb9ca93483f5008dc1e 100644 (file)
@@ -416,11 +416,8 @@ static int bd70528_probe(struct platform_device *pdev)
        bd_rtc->dev = &pdev->dev;
 
        irq = platform_get_irq_byname(pdev, "bd70528-rtc-alm");
-
-       if (irq < 0) {
-               dev_err(&pdev->dev, "Failed to get irq\n");
+       if (irq < 0)
                return irq;
-       }
 
        platform_set_drvdata(pdev, bd_rtc);
 
index fcb71bf4d4921abd46b764cd56cba22908aa95d0..d8e0db2e7fc646055c15e594884720fd256bf8f6 100644 (file)
@@ -477,10 +477,8 @@ static int __init davinci_rtc_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        davinci_rtc->irq = platform_get_irq(pdev, 0);
-       if (davinci_rtc->irq < 0) {
-               dev_err(dev, "no RTC irq\n");
+       if (davinci_rtc->irq < 0)
                return davinci_rtc->irq;
-       }
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        davinci_rtc->base = devm_ioremap_resource(dev, res);
index 9e7b3a04debc11fc8abd6949165d467f17f89dfe..3ec6bb230cd5f811e7ddec50c9740a25f1ab4475 100644 (file)
@@ -323,10 +323,8 @@ static int jz4740_rtc_probe(struct platform_device *pdev)
                rtc->type = id->driver_data;
 
        rtc->irq = platform_get_irq(pdev, 0);
-       if (rtc->irq < 0) {
-               dev_err(&pdev->dev, "Failed to get platform irq\n");
+       if (rtc->irq < 0)
                return -ENOENT;
-       }
 
        mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        rtc->base = devm_ioremap_resource(&pdev->dev, mem);
index 3d924c34fd73fb5b1b1af86151734b974bb4889c..7a98e07448783c4dbd343a245d83c73ef3ccf403 100644 (file)
@@ -673,11 +673,8 @@ static int max77686_init_rtc_regmap(struct max77686_rtc_info *info)
                struct platform_device *pdev = to_platform_device(info->dev);
 
                info->rtc_irq = platform_get_irq(pdev, 0);
-               if (info->rtc_irq < 0) {
-                       dev_err(info->dev, "Failed to get rtc interrupts: %d\n",
-                               info->rtc_irq);
+               if (info->rtc_irq < 0)
                        return info->rtc_irq;
-               }
        } else {
                info->rtc_irq =  parent_i2c->irq;
        }
index 82b0816ec6c172139c8e1bd052bc624f50d875e5..16bd26b5aa6f3f04a0b9f6f760c0da539bd558dc 100644 (file)
@@ -329,7 +329,6 @@ static int mtk_rtc_probe(struct platform_device *pdev)
 
        hw->irq = platform_get_irq(pdev, 0);
        if (hw->irq < 0) {
-               dev_err(&pdev->dev, "No IRQ resource\n");
                ret = hw->irq;
                goto err;
        }
index 1c4de6e90da08545e21b411c0ce3667888f7da3f..17653ed52ebbfd73a34680a13b6b557fa647c4d2 100644 (file)
@@ -308,10 +308,8 @@ static int pic32_rtc_probe(struct platform_device *pdev)
        platform_set_drvdata(pdev, pdata);
 
        pdata->alarm_irq = platform_get_irq(pdev, 0);
-       if (pdata->alarm_irq < 0) {
-               dev_err(&pdev->dev, "no irq for alarm\n");
+       if (pdata->alarm_irq < 0)
                return pdata->alarm_irq;
-       }
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        pdata->reg_base = devm_ioremap_resource(&pdev->dev, res);
index 9f9839c47e2ffbc91dd400bf23089afde1cd87b4..f5a30e0f16c2cca677b98327398edf3902883c58 100644 (file)
@@ -468,10 +468,8 @@ static int pm8xxx_rtc_probe(struct platform_device *pdev)
        }
 
        rtc_dd->rtc_alarm_irq = platform_get_irq(pdev, 0);
-       if (rtc_dd->rtc_alarm_irq < 0) {
-               dev_err(&pdev->dev, "Alarm IRQ resource absent!\n");
+       if (rtc_dd->rtc_alarm_irq < 0)
                return -ENXIO;
-       }
 
        rtc_dd->allow_set_time = of_property_read_bool(pdev->dev.of_node,
                                                      "allow-set-time");
index 63b9e73fb97d7d584761751feb42b603b79f3a79..56a7cf1547a72f4a2f582cc0585dead3c36ab533 100644 (file)
@@ -186,16 +186,12 @@ static int puv3_rtc_probe(struct platform_device *pdev)
 
        /* find the IRQs */
        puv3_rtc_tickno = platform_get_irq(pdev, 1);
-       if (puv3_rtc_tickno < 0) {
-               dev_err(&pdev->dev, "no irq for rtc tick\n");
+       if (puv3_rtc_tickno < 0)
                return -ENOENT;
-       }
 
        puv3_rtc_alarmno = platform_get_irq(pdev, 0);
-       if (puv3_rtc_alarmno < 0) {
-               dev_err(&pdev->dev, "no irq for alarm\n");
+       if (puv3_rtc_alarmno < 0)
                return -ENOENT;
-       }
 
        dev_dbg(&pdev->dev, "PKUnity_rtc: tick irq %d, alarm irq %d\n",
                 puv3_rtc_tickno, puv3_rtc_alarmno);
index a7827fe7fb7b35790feba8d19077415d3d685793..d2f1d8f754bf3a3797b404ef0dc6cc9fca5d26c9 100644 (file)
@@ -324,15 +324,11 @@ static int __init pxa_rtc_probe(struct platform_device *pdev)
        }
 
        sa1100_rtc->irq_1hz = platform_get_irq(pdev, 0);
-       if (sa1100_rtc->irq_1hz < 0) {
-               dev_err(dev, "No 1Hz IRQ resource defined\n");
+       if (sa1100_rtc->irq_1hz < 0)
                return -ENXIO;
-       }
        sa1100_rtc->irq_alarm = platform_get_irq(pdev, 1);
-       if (sa1100_rtc->irq_alarm < 0) {
-               dev_err(dev, "No alarm IRQ resource defined\n");
+       if (sa1100_rtc->irq_alarm < 0)
                return -ENXIO;
-       }
 
        pxa_rtc->base = devm_ioremap(dev, pxa_rtc->ress->start,
                                resource_size(pxa_rtc->ress));
index c34540baa12af0197fd18587b34cbad96a5842a7..c0334c602e88efe022a3e78976ceb91c034536f0 100644 (file)
@@ -434,12 +434,8 @@ static int rk808_rtc_probe(struct platform_device *pdev)
        rk808_rtc->rtc->ops = &rk808_rtc_ops;
 
        rk808_rtc->irq = platform_get_irq(pdev, 0);
-       if (rk808_rtc->irq < 0) {
-               if (rk808_rtc->irq != -EPROBE_DEFER)
-                       dev_err(&pdev->dev, "Wake up is not possible as irq = %d\n",
-                               rk808_rtc->irq);
+       if (rk808_rtc->irq < 0)
                return rk808_rtc->irq;
-       }
 
        /* request alarm irq of rk808 */
        ret = devm_request_threaded_irq(&pdev->dev, rk808_rtc->irq, NULL,
index 74bf6473a05d3eec357e429f6e06d88e96cdac24..7801249c254bb517e010651894288d51a75f5322 100644 (file)
@@ -453,10 +453,8 @@ static int s3c_rtc_probe(struct platform_device *pdev)
 
        /* find the IRQs */
        info->irq_tick = platform_get_irq(pdev, 1);
-       if (info->irq_tick < 0) {
-               dev_err(&pdev->dev, "no irq for rtc tick\n");
+       if (info->irq_tick < 0)
                return info->irq_tick;
-       }
 
        info->dev = &pdev->dev;
        info->data = of_device_get_match_data(&pdev->dev);
@@ -470,10 +468,8 @@ static int s3c_rtc_probe(struct platform_device *pdev)
        platform_set_drvdata(pdev, info);
 
        info->irq_alarm = platform_get_irq(pdev, 0);
-       if (info->irq_alarm < 0) {
-               dev_err(&pdev->dev, "no irq for alarm\n");
+       if (info->irq_alarm < 0)
                return info->irq_alarm;
-       }
 
        dev_dbg(&pdev->dev, "s3c2410_rtc: tick irq %d, alarm irq %d\n",
                info->irq_tick, info->irq_alarm);
index b4eb3b3c6c2cb810ce300939d03d6d0fa82bd3f0..698e1e51efca97ef4e3a35b21cffdfe5b0242f53 100644 (file)
@@ -614,10 +614,8 @@ static int sprd_rtc_probe(struct platform_device *pdev)
        }
 
        rtc->irq = platform_get_irq(pdev, 0);
-       if (rtc->irq < 0) {
-               dev_err(&pdev->dev, "failed to get RTC irq number\n");
+       if (rtc->irq < 0)
                return rtc->irq;
-       }
 
        rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
        if (IS_ERR(rtc->rtc))
index 0567944fd4f89ada811158b0315e2eb473ce4f48..9f23b24f466c2865167d01252e66af5aa8c5506f 100644 (file)
@@ -358,10 +358,8 @@ static int spear_rtc_probe(struct platform_device *pdev)
 
        /* alarm irqs */
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "no update irq?\n");
+       if (irq < 0)
                return irq;
-       }
 
        status = devm_request_irq(&pdev->dev, irq, spear_rtc_irq, 0, pdev->name,
                        config);
index 773a1990b93f1a08c768e368dc1a912b6c7d0ec8..2999e33a7e3764a041d30f00456e72ee41205a6b 100644 (file)
@@ -776,7 +776,6 @@ static int stm32_rtc_probe(struct platform_device *pdev)
 
        rtc->irq_alarm = platform_get_irq(pdev, 0);
        if (rtc->irq_alarm <= 0) {
-               dev_err(&pdev->dev, "no alarm irq\n");
                ret = rtc->irq_alarm;
                goto err;
        }
index c0e75c373605909b99cff0f3a87198a05c913aa9..dbd676db431e63c3990a3cb8fbc0ae376080302f 100644 (file)
@@ -610,10 +610,8 @@ static int sun6i_rtc_probe(struct platform_device *pdev)
        chip->dev = &pdev->dev;
 
        chip->irq = platform_get_irq(pdev, 0);
-       if (chip->irq < 0) {
-               dev_err(&pdev->dev, "No IRQ resource\n");
+       if (chip->irq < 0)
                return chip->irq;
-       }
 
        ret = devm_request_irq(&pdev->dev, chip->irq, sun6i_rtc_alarmirq,
                               0, dev_name(&pdev->dev), chip);
index 6eeabb81106fa3f021c05b9fd867d3cdd6fd5cd2..0bb69a7f9e462c2d32fb7425a34a7ff1c79ec4ef 100644 (file)
@@ -442,10 +442,8 @@ static int sunxi_rtc_probe(struct platform_device *pdev)
                return PTR_ERR(chip->base);
 
        chip->irq = platform_get_irq(pdev, 0);
-       if (chip->irq < 0) {
-               dev_err(&pdev->dev, "No IRQ resource\n");
+       if (chip->irq < 0)
                return chip->irq;
-       }
        ret = devm_request_irq(&pdev->dev, chip->irq, sunxi_rtc_alarmirq,
                        0, dev_name(&pdev->dev), chip);
        if (ret) {
index 8fa1b3febf69d42ce76efa50859c67aea8f77290..14bf835229e68f9f6c935a9bb6de2d8613a19dec 100644 (file)
@@ -290,10 +290,8 @@ static int tegra_rtc_probe(struct platform_device *pdev)
                return PTR_ERR(info->base);
 
        ret = platform_get_irq(pdev, 0);
-       if (ret <= 0) {
-               dev_err(&pdev->dev, "failed to get platform IRQ: %d\n", ret);
+       if (ret <= 0)
                return ret;
-       }
 
        info->irq = ret;
 
index f59d232810de14afed76298963a3c789740657e9..d5d14cf86e0dad353304a84b5b8e4f435d0c317f 100644 (file)
@@ -212,10 +212,8 @@ static int vt8500_rtc_probe(struct platform_device *pdev)
        platform_set_drvdata(pdev, vt8500_rtc);
 
        vt8500_rtc->irq_alarm = platform_get_irq(pdev, 0);
-       if (vt8500_rtc->irq_alarm < 0) {
-               dev_err(&pdev->dev, "No alarm IRQ resource defined\n");
+       if (vt8500_rtc->irq_alarm < 0)
                return vt8500_rtc->irq_alarm;
-       }
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        vt8500_rtc->regbase = devm_ioremap_resource(&pdev->dev, res);
index 9888383f0088e625bce6ab0eb0cb0d765c771714..9683fbf7c78d22146e30e3f7c01746ea4239ce50 100644 (file)
@@ -157,10 +157,8 @@ static int xgene_rtc_probe(struct platform_device *pdev)
                return PTR_ERR(pdata->rtc);
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "No IRQ resource\n");
+       if (irq < 0)
                return irq;
-       }
        ret = devm_request_irq(&pdev->dev, irq, xgene_rtc_interrupt, 0,
                               dev_name(&pdev->dev), pdata);
        if (ret) {
index 00639594de0cec74afd137f0fde1878ffe644128..2c762757fb5423d93d70f4f9bfcae94f5773eb74 100644 (file)
@@ -218,10 +218,8 @@ static int xlnx_rtc_probe(struct platform_device *pdev)
                return PTR_ERR(xrtcdev->reg_base);
 
        xrtcdev->alarm_irq = platform_get_irq_byname(pdev, "alarm");
-       if (xrtcdev->alarm_irq < 0) {
-               dev_err(&pdev->dev, "no irq resource\n");
+       if (xrtcdev->alarm_irq < 0)
                return xrtcdev->alarm_irq;
-       }
        ret = devm_request_irq(&pdev->dev, xrtcdev->alarm_irq,
                               xlnx_rtc_interrupt, 0,
                               dev_name(&pdev->dev), xrtcdev);
@@ -231,10 +229,8 @@ static int xlnx_rtc_probe(struct platform_device *pdev)
        }
 
        xrtcdev->sec_irq = platform_get_irq_byname(pdev, "sec");
-       if (xrtcdev->sec_irq < 0) {
-               dev_err(&pdev->dev, "no irq resource\n");
+       if (xrtcdev->sec_irq < 0)
                return xrtcdev->sec_irq;
-       }
        ret = devm_request_irq(&pdev->dev, xrtcdev->sec_irq,
                               xlnx_rtc_interrupt, 0,
                               dev_name(&pdev->dev), xrtcdev);