iommu: Remove dev_err() usage after platform_get_irq()
authorStephen Boyd <swboyd@chromium.org>
Tue, 30 Jul 2019 18:15:22 +0000 (11:15 -0700)
committerJoerg Roedel <jroedel@suse.de>
Fri, 9 Aug 2019 15:33:19 +0000 (17:33 +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: Joerg Roedel <joro@8bytes.org>
Cc: iommu@lists.linux-foundation.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/exynos-iommu.c
drivers/iommu/msm_iommu.c
drivers/iommu/qcom_iommu.c

index b0c1e5f9daae5acc353ef91c5d0ab44f773fa318..1934c16a5abc1fa2573cd321aaba13702ad09683 100644 (file)
@@ -583,10 +583,8 @@ static int __init exynos_sysmmu_probe(struct platform_device *pdev)
                return PTR_ERR(data->sfrbase);
 
        irq = platform_get_irq(pdev, 0);
-       if (irq <= 0) {
-               dev_err(dev, "Unable to find IRQ resource\n");
+       if (irq <= 0)
                return irq;
-       }
 
        ret = devm_request_irq(dev, irq, exynos_sysmmu_irq, 0,
                                dev_name(dev), data);
index b25e2eb9e038d9460a94b487d66c718693f3c8cc..3df9266abe656dabd2b436c3b9e6358895af36f3 100644 (file)
@@ -750,7 +750,6 @@ static int msm_iommu_probe(struct platform_device *pdev)
 
        iommu->irq = platform_get_irq(pdev, 0);
        if (iommu->irq < 0) {
-               dev_err(iommu->dev, "could not get iommu irq\n");
                ret = -ENODEV;
                goto fail;
        }
index 34d0b9783b3ed6f57c3fcbe9ec46d16db1e92116..fb45486c6d14e255f34e5dfcb6091fc5f1129cc6 100644 (file)
@@ -696,10 +696,8 @@ static int qcom_iommu_ctx_probe(struct platform_device *pdev)
                return PTR_ERR(ctx->base);
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(dev, "failed to get irq\n");
+       if (irq < 0)
                return -ENODEV;
-       }
 
        /* clear IRQs before registering fault handler, just in case the
         * boot-loader left us a surprise: