]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mmc: Remove dev_err() usage after platform_get_irq()
authorStephen Boyd <swboyd@chromium.org>
Tue, 30 Jul 2019 18:15:29 +0000 (11:15 -0700)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 11 Sep 2019 13:58:39 +0000 (15:58 +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: Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-mmc@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/bcm2835.c
drivers/mmc/host/jz4740_mmc.c
drivers/mmc/host/meson-gx-mmc.c
drivers/mmc/host/mxcmmc.c
drivers/mmc/host/s3cmci.c
drivers/mmc/host/sdhci-msm.c
drivers/mmc/host/sdhci-pltfm.c
drivers/mmc/host/sdhci-s3c.c
drivers/mmc/host/sdhci_f_sdh30.c
drivers/mmc/host/uniphier-sd.c

index 7e0d3a49c06d8ec443f0b8493c617411efbf7af8..e1b7757c48fe1ec74be7d48914370e11c9c2008a 100644 (file)
@@ -1409,7 +1409,6 @@ static int bcm2835_probe(struct platform_device *pdev)
 
        host->irq = platform_get_irq(pdev, 0);
        if (host->irq <= 0) {
-               dev_err(dev, "get IRQ failed\n");
                ret = -EINVAL;
                goto err;
        }
index ffdbfaadd3f2909b44050ab5096afe3fdf100129..672708543a117d39399c3ecc431e5d2224b2392a 100644 (file)
@@ -969,7 +969,6 @@ static int jz4740_mmc_probe(struct platform_device* pdev)
        host->irq = platform_get_irq(pdev, 0);
        if (host->irq < 0) {
                ret = host->irq;
-               dev_err(&pdev->dev, "Failed to get platform irq: %d\n", ret);
                goto err_free_host;
        }
 
index 037311db3551f2ec98318eaf1da1b4196b09da3a..e712315c7e8d29c72d020d3f398f9b8b212ccbda 100644 (file)
@@ -1091,7 +1091,6 @@ static int meson_mmc_probe(struct platform_device *pdev)
 
        host->irq = platform_get_irq(pdev, 0);
        if (host->irq <= 0) {
-               dev_err(&pdev->dev, "failed to get interrupt resource.\n");
                ret = -EINVAL;
                goto free_host;
        }
index 750604f7fac9388c7194ff2b55e059da96f50c2f..011b59a3602eb8abc0ed2aa86dc9ab55161eec5a 100644 (file)
@@ -1010,10 +1010,8 @@ static int mxcmci_probe(struct platform_device *pdev)
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "failed to get IRQ: %d\n", irq);
+       if (irq < 0)
                return irq;
-       }
 
        mmc = mmc_alloc_host(sizeof(*host), &pdev->dev);
        if (!mmc)
index ccc5f095775f36fb75683e867f026a3dc2053809..bce9c33bc4b55caeff41bbe3aceb42587508ea3b 100644 (file)
@@ -1614,7 +1614,6 @@ static int s3cmci_probe(struct platform_device *pdev)
 
        host->irq = platform_get_irq(pdev, 0);
        if (host->irq <= 0) {
-               dev_err(&pdev->dev, "failed to get interrupt resource.\n");
                ret = -EINVAL;
                goto probe_iounmap;
        }
index 9cf14b359c144f788b6686e799d458052c61b63d..b75c82d8d6c17064951f625ab5d8ae4309f15f72 100644 (file)
@@ -1917,8 +1917,6 @@ static int sdhci_msm_probe(struct platform_device *pdev)
        /* Setup IRQ for handling power/voltage tasks with PMIC */
        msm_host->pwr_irq = platform_get_irq_byname(pdev, "pwr_irq");
        if (msm_host->pwr_irq < 0) {
-               dev_err(&pdev->dev, "Get pwr_irq failed (%d)\n",
-                       msm_host->pwr_irq);
                ret = msm_host->pwr_irq;
                goto clk_disable;
        }
index 11ecff9e998de65c6285087fdb182c3800cfcf91..328b132bbe5723def53d4a51e4b0ad4b7d860c92 100644 (file)
@@ -129,7 +129,6 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
 
        irq = platform_get_irq(pdev, 0);
        if (irq < 0) {
-               dev_err(&pdev->dev, "failed to get IRQ number\n");
                ret = irq;
                goto err;
        }
index b631c66550d86343b2a4cad2dd0df994a2fdd0f6..51e096f27388edd909e62e0091a5a36058f93fc7 100644 (file)
@@ -490,10 +490,8 @@ static int sdhci_s3c_probe(struct platform_device *pdev)
        }
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(dev, "no irq specified\n");
+       if (irq < 0)
                return irq;
-       }
 
        host = sdhci_alloc_host(dev, sizeof(struct sdhci_s3c));
        if (IS_ERR(host)) {
index e369cbf1ff0243244b6ae61a6a929335b26bc9f3..f8b939e63e027b26182b0088553aaf71ebef3782 100644 (file)
@@ -119,10 +119,8 @@ static int sdhci_f_sdh30_probe(struct platform_device *pdev)
        u32 reg = 0;
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(dev, "%s: no irq specified\n", __func__);
+       if (irq < 0)
                return irq;
-       }
 
        host = sdhci_alloc_host(dev, sizeof(struct f_sdhost_priv));
        if (IS_ERR(host))
index 49aad9a79c18d24aba0d45340964d24b5656aeb9..e09336f9166d65d594e903a0c5697a508f78ecca 100644 (file)
@@ -557,10 +557,8 @@ static int uniphier_sd_probe(struct platform_device *pdev)
        int irq, ret;
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(dev, "failed to get IRQ number");
+       if (irq < 0)
                return irq;
-       }
 
        priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
        if (!priv)