crypto: drivers - Remove dev_err() usage after platform_get_irq()
authorStephen Boyd <swboyd@chromium.org>
Tue, 30 Jul 2019 18:15:05 +0000 (11:15 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 9 Aug 2019 05:11:38 +0000 (15:11 +1000)
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: <linux-crypto@vger.kernel.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
13 files changed:
drivers/crypto/atmel-aes.c
drivers/crypto/atmel-sha.c
drivers/crypto/atmel-tdes.c
drivers/crypto/ccree/cc_driver.c
drivers/crypto/img-hash.c
drivers/crypto/mediatek/mtk-platform.c
drivers/crypto/mxs-dcp.c
drivers/crypto/omap-aes.c
drivers/crypto/omap-des.c
drivers/crypto/omap-sham.c
drivers/crypto/sahara.c
drivers/crypto/stm32/stm32-cryp.c
drivers/crypto/stm32/stm32-hash.c

index 2b7af44c7b85309cde6402eddeadcdf3415a5e7b..026f193556f9df8b759dc90be596206c556ebcef 100644 (file)
@@ -2673,7 +2673,6 @@ static int atmel_aes_probe(struct platform_device *pdev)
        /* Get the IRQ */
        aes_dd->irq = platform_get_irq(pdev,  0);
        if (aes_dd->irq < 0) {
-               dev_err(dev, "no IRQ resource info\n");
                err = aes_dd->irq;
                goto res_err;
        }
index ab0cfe748931a6a1c70d4530eb44b70008bcb44c..84cb8748a79595d4310c5bcfb4fc07a01f361628 100644 (file)
@@ -2779,7 +2779,6 @@ static int atmel_sha_probe(struct platform_device *pdev)
        /* Get the IRQ */
        sha_dd->irq = platform_get_irq(pdev,  0);
        if (sha_dd->irq < 0) {
-               dev_err(dev, "no IRQ resource info\n");
                err = sha_dd->irq;
                goto res_err;
        }
index fa76620281e803aae994f7a28241a3e8505e94e5..6256883a89ed54b959b61903eb89f87d65a51171 100644 (file)
@@ -1281,7 +1281,6 @@ static int atmel_tdes_probe(struct platform_device *pdev)
        /* Get the IRQ */
        tdes_dd->irq = platform_get_irq(pdev,  0);
        if (tdes_dd->irq < 0) {
-               dev_err(dev, "no IRQ resource info\n");
                err = tdes_dd->irq;
                goto res_err;
        }
index 196e3d1403557fe2effdadcb6bb068654762d90f..8b8eee513c279815223d05c731066476184653c8 100644 (file)
@@ -338,10 +338,8 @@ static int init_cc_resources(struct platform_device *plat_dev)
 
        /* Then IRQ */
        new_drvdata->irq = platform_get_irq(plat_dev, 0);
-       if (new_drvdata->irq < 0) {
-               dev_err(dev, "Failed getting IRQ resource\n");
+       if (new_drvdata->irq < 0)
                return new_drvdata->irq;
-       }
 
        init_completion(&new_drvdata->hw_queue_avail);
 
index d27c812c3d8d227ce3c6d00c724ea4e04932a389..6754eaafdc859206dd551d63f5d30e0fcdef6de8 100644 (file)
@@ -980,7 +980,6 @@ static int img_hash_probe(struct platform_device *pdev)
 
        irq = platform_get_irq(pdev, 0);
        if (irq < 0) {
-               dev_err(dev, "no IRQ resource info\n");
                err = irq;
                goto res_err;
        }
index 125318a88cd4edca93dacb5e2f9db3934c355553..4f43318ca14b5189b233743cebedc94640676d1f 100644 (file)
@@ -495,10 +495,8 @@ static int mtk_crypto_probe(struct platform_device *pdev)
 
        for (i = 0; i < MTK_IRQ_NUM; i++) {
                cryp->irq[i] = platform_get_irq(pdev, i);
-               if (cryp->irq[i] < 0) {
-                       dev_err(cryp->dev, "no IRQ:%d resource info\n", i);
+               if (cryp->irq[i] < 0)
                        return cryp->irq[i];
-               }
        }
 
        cryp->clk_cryp = devm_clk_get(&pdev->dev, "cryp");
index f1fa637cb029d0b234fd1c025e57633b83108092..bf8d2197bc11e98c3363b4acfc4380f233295063 100644 (file)
@@ -994,16 +994,12 @@ static int mxs_dcp_probe(struct platform_device *pdev)
        }
 
        dcp_vmi_irq = platform_get_irq(pdev, 0);
-       if (dcp_vmi_irq < 0) {
-               dev_err(dev, "Failed to get IRQ: (%d)!\n", dcp_vmi_irq);
+       if (dcp_vmi_irq < 0)
                return dcp_vmi_irq;
-       }
 
        dcp_irq = platform_get_irq(pdev, 1);
-       if (dcp_irq < 0) {
-               dev_err(dev, "Failed to get IRQ: (%d)!\n", dcp_irq);
+       if (dcp_irq < 0)
                return dcp_irq;
-       }
 
        sdcp = devm_kzalloc(dev, sizeof(*sdcp), GFP_KERNEL);
        if (!sdcp)
index 45a4647f7030ac88d3974a092ae912c96046c55c..2f53fbb7410010b8eca1cdcbfd5b70c9db2de58d 100644 (file)
@@ -1180,7 +1180,6 @@ static int omap_aes_probe(struct platform_device *pdev)
 
                irq = platform_get_irq(pdev, 0);
                if (irq < 0) {
-                       dev_err(dev, "can't get IRQ resource\n");
                        err = irq;
                        goto err_irq;
                }
index 1ee69a97967767c022bd1011651099051536a5f2..484a693122af8a2776ca60e342b46e166069400d 100644 (file)
@@ -1049,7 +1049,6 @@ static int omap_des_probe(struct platform_device *pdev)
 
                irq = platform_get_irq(pdev, 0);
                if (irq < 0) {
-                       dev_err(dev, "can't get IRQ resource: %d\n", irq);
                        err = irq;
                        goto err_irq;
                }
index e8e2907bd9f40f28e8c7b6f4d24e88088631e70f..ac80bc6af093059565ac03960dba01f1ef92e91b 100644 (file)
@@ -1989,7 +1989,6 @@ static int omap_sham_get_res_pdev(struct omap_sham_dev *dd,
        /* Get the IRQ */
        dd->irq = platform_get_irq(pdev, 0);
        if (dd->irq < 0) {
-               dev_err(dev, "no IRQ resource info\n");
                err = dd->irq;
                goto err;
        }
index b0b8e3d48aef1c7fc9bed475d9eadec929152614..8ac8ec6decd533ecdc1d527703890ca32198e592 100644 (file)
@@ -1403,10 +1403,8 @@ static int sahara_probe(struct platform_device *pdev)
 
        /* Get the IRQ */
        irq = platform_get_irq(pdev,  0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "failed to get irq resource\n");
+       if (irq < 0)
                return irq;
-       }
 
        err = devm_request_irq(&pdev->dev, irq, sahara_irq_handler,
                               0, dev_name(&pdev->dev), dev);
index 98ae02826e8fb9b6f5dd5d7ce26376f168358149..72f86063b046593b2a916d36c3e4c7561222c603 100644 (file)
@@ -1975,10 +1975,8 @@ static int stm32_cryp_probe(struct platform_device *pdev)
                return PTR_ERR(cryp->regs);
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(dev, "Cannot get IRQ resource\n");
+       if (irq < 0)
                return irq;
-       }
 
        ret = devm_request_threaded_irq(dev, irq, stm32_cryp_irq,
                                        stm32_cryp_irq_thread, IRQF_ONESHOT,
index 2b70d8796f25b5884920b8708760963e89503d42..cfc8e0e37beec8f1ece81ba9d891fc5a9efb0118 100644 (file)
@@ -1450,10 +1450,8 @@ static int stm32_hash_probe(struct platform_device *pdev)
                return ret;
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(dev, "Cannot get IRQ resource\n");
+       if (irq < 0)
                return irq;
-       }
 
        ret = devm_request_threaded_irq(dev, irq, stm32_hash_irq_handler,
                                        stm32_hash_irq_thread, IRQF_ONESHOT,