]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
mfd: Remove dev_err() usage after platform_get_irq()
authorStephen Boyd <swboyd@chromium.org>
Tue, 30 Jul 2019 18:15:27 +0000 (11:15 -0700)
committerLee Jones <lee.jones@linaro.org>
Mon, 12 Aug 2019 10:29:47 +0000 (11:29 +0100)
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).

Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/ab8500-debugfs.c
drivers/mfd/db8500-prcmu.c
drivers/mfd/fsl-imx25-tsadc.c
drivers/mfd/intel_soc_pmic_bxtwc.c
drivers/mfd/qcom_rpm.c
drivers/mfd/sm501.c

index 567a34b073dd6b4edcea756fa95df183b6a61ffb..f4e26b6e5362de32017f9feceabfc01519387e95 100644 (file)
@@ -2680,16 +2680,12 @@ static int ab8500_debug_probe(struct platform_device *plf)
        irq_ab8500 = res->start;
 
        irq_first = platform_get_irq_byname(plf, "IRQ_FIRST");
-       if (irq_first < 0) {
-               dev_err(&plf->dev, "First irq not found, err %d\n", irq_first);
+       if (irq_first < 0)
                return irq_first;
-       }
 
        irq_last = platform_get_irq_byname(plf, "IRQ_LAST");
-       if (irq_last < 0) {
-               dev_err(&plf->dev, "Last irq not found, err %d\n", irq_last);
+       if (irq_last < 0)
                return irq_last;
-       }
 
        ab8500_dir = debugfs_create_dir(AB8500_NAME_STRING, NULL);
 
index 90e0f21bc49c55045bb03ff7582200b403b320a7..0f459c246634ca925a6a2a048ef6aae64b2ae483 100644 (file)
@@ -3130,10 +3130,8 @@ static int db8500_prcmu_probe(struct platform_device *pdev)
        writel(ALL_MBOX_BITS, PRCM_ARM_IT1_CLR);
 
        irq = platform_get_irq(pdev, 0);
-       if (irq <= 0) {
-               dev_err(&pdev->dev, "no prcmu irq provided\n");
+       if (irq <= 0)
                return irq;
-       }
 
        err = request_threaded_irq(irq, prcmu_irq_handler,
                prcmu_irq_thread_fn, IRQF_NO_SUSPEND, "prcmu", NULL);
index 20791cab72634bf088cf0df7decda0c4181f25d1..a016b39fe9b0e54eaf0b3c97811c133cce9bfed4 100644 (file)
@@ -69,10 +69,8 @@ static int mx25_tsadc_setup_irq(struct platform_device *pdev,
        int irq;
 
        irq = platform_get_irq(pdev, 0);
-       if (irq <= 0) {
-               dev_err(dev, "Failed to get irq\n");
+       if (irq <= 0)
                return irq;
-       }
 
        tsadc->domain = irq_domain_add_simple(np, 2, 0, &mx25_tsadc_domain_ops,
                                              tsadc);
index 6310c3bdb99157650364825b2d5f900ba25bb4f0..739cfb5b69fe75570c2e2e4ead95b26220f3fabb 100644 (file)
@@ -450,10 +450,8 @@ static int bxtwc_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        ret = platform_get_irq(pdev, 0);
-       if (ret < 0) {
-               dev_err(&pdev->dev, "Invalid IRQ\n");
+       if (ret < 0)
                return ret;
-       }
        pmic->irq = ret;
 
        dev_set_drvdata(&pdev->dev, pmic);
index 4d7e9008628c68a8eea276f10a7021d574b9ba10..71bc34b74bc9c07aa9a750017ecd28153ef5d445 100644 (file)
@@ -561,22 +561,16 @@ static int qcom_rpm_probe(struct platform_device *pdev)
        clk_prepare_enable(rpm->ramclk); /* Accepts NULL */
 
        irq_ack = platform_get_irq_byname(pdev, "ack");
-       if (irq_ack < 0) {
-               dev_err(&pdev->dev, "required ack interrupt missing\n");
+       if (irq_ack < 0)
                return irq_ack;
-       }
 
        irq_err = platform_get_irq_byname(pdev, "err");
-       if (irq_err < 0) {
-               dev_err(&pdev->dev, "required err interrupt missing\n");
+       if (irq_err < 0)
                return irq_err;
-       }
 
        irq_wakeup = platform_get_irq_byname(pdev, "wakeup");
-       if (irq_wakeup < 0) {
-               dev_err(&pdev->dev, "required wakeup interrupt missing\n");
+       if (irq_wakeup < 0)
                return irq_wakeup;
-       }
 
        match = of_match_device(qcom_rpm_of_match, &pdev->dev);
        if (!match)
index 9b9b06d36cb100c66d783ae688b429a0118c09ee..d5e34a5eb25023751fb841718005f4f47ade3667 100644 (file)
@@ -1394,10 +1394,8 @@ static int sm501_plat_probe(struct platform_device *dev)
        sm->platdata = dev_get_platdata(&dev->dev);
 
        ret = platform_get_irq(dev, 0);
-       if (ret < 0) {
-               dev_err(&dev->dev, "failed to get irq resource\n");
+       if (ret < 0)
                goto err_res;
-       }
        sm->irq = ret;
 
        sm->io_res = platform_get_resource(dev, IORESOURCE_MEM, 1);