Commit 514838e9 authored by Stephen Boyd's avatar Stephen Boyd Committed by Herbert Xu

crypto: drivers - Remove dev_err() usage after platform_get_irq()

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: default avatarStephen Boyd <swboyd@chromium.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent f26882a3
...@@ -2673,7 +2673,6 @@ static int atmel_aes_probe(struct platform_device *pdev) ...@@ -2673,7 +2673,6 @@ static int atmel_aes_probe(struct platform_device *pdev)
/* Get the IRQ */ /* Get the IRQ */
aes_dd->irq = platform_get_irq(pdev, 0); aes_dd->irq = platform_get_irq(pdev, 0);
if (aes_dd->irq < 0) { if (aes_dd->irq < 0) {
dev_err(dev, "no IRQ resource info\n");
err = aes_dd->irq; err = aes_dd->irq;
goto res_err; goto res_err;
} }
......
...@@ -2779,7 +2779,6 @@ static int atmel_sha_probe(struct platform_device *pdev) ...@@ -2779,7 +2779,6 @@ static int atmel_sha_probe(struct platform_device *pdev)
/* Get the IRQ */ /* Get the IRQ */
sha_dd->irq = platform_get_irq(pdev, 0); sha_dd->irq = platform_get_irq(pdev, 0);
if (sha_dd->irq < 0) { if (sha_dd->irq < 0) {
dev_err(dev, "no IRQ resource info\n");
err = sha_dd->irq; err = sha_dd->irq;
goto res_err; goto res_err;
} }
......
...@@ -1281,7 +1281,6 @@ static int atmel_tdes_probe(struct platform_device *pdev) ...@@ -1281,7 +1281,6 @@ static int atmel_tdes_probe(struct platform_device *pdev)
/* Get the IRQ */ /* Get the IRQ */
tdes_dd->irq = platform_get_irq(pdev, 0); tdes_dd->irq = platform_get_irq(pdev, 0);
if (tdes_dd->irq < 0) { if (tdes_dd->irq < 0) {
dev_err(dev, "no IRQ resource info\n");
err = tdes_dd->irq; err = tdes_dd->irq;
goto res_err; goto res_err;
} }
......
...@@ -338,10 +338,8 @@ static int init_cc_resources(struct platform_device *plat_dev) ...@@ -338,10 +338,8 @@ static int init_cc_resources(struct platform_device *plat_dev)
/* Then IRQ */ /* Then IRQ */
new_drvdata->irq = platform_get_irq(plat_dev, 0); new_drvdata->irq = platform_get_irq(plat_dev, 0);
if (new_drvdata->irq < 0) { if (new_drvdata->irq < 0)
dev_err(dev, "Failed getting IRQ resource\n");
return new_drvdata->irq; return new_drvdata->irq;
}
init_completion(&new_drvdata->hw_queue_avail); init_completion(&new_drvdata->hw_queue_avail);
......
...@@ -980,7 +980,6 @@ static int img_hash_probe(struct platform_device *pdev) ...@@ -980,7 +980,6 @@ static int img_hash_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0) {
dev_err(dev, "no IRQ resource info\n");
err = irq; err = irq;
goto res_err; goto res_err;
} }
......
...@@ -495,10 +495,8 @@ static int mtk_crypto_probe(struct platform_device *pdev) ...@@ -495,10 +495,8 @@ static int mtk_crypto_probe(struct platform_device *pdev)
for (i = 0; i < MTK_IRQ_NUM; i++) { for (i = 0; i < MTK_IRQ_NUM; i++) {
cryp->irq[i] = platform_get_irq(pdev, i); cryp->irq[i] = platform_get_irq(pdev, i);
if (cryp->irq[i] < 0) { if (cryp->irq[i] < 0)
dev_err(cryp->dev, "no IRQ:%d resource info\n", i);
return cryp->irq[i]; return cryp->irq[i];
}
} }
cryp->clk_cryp = devm_clk_get(&pdev->dev, "cryp"); cryp->clk_cryp = devm_clk_get(&pdev->dev, "cryp");
......
...@@ -994,16 +994,12 @@ static int mxs_dcp_probe(struct platform_device *pdev) ...@@ -994,16 +994,12 @@ static int mxs_dcp_probe(struct platform_device *pdev)
} }
dcp_vmi_irq = platform_get_irq(pdev, 0); dcp_vmi_irq = platform_get_irq(pdev, 0);
if (dcp_vmi_irq < 0) { if (dcp_vmi_irq < 0)
dev_err(dev, "Failed to get IRQ: (%d)!\n", dcp_vmi_irq);
return dcp_vmi_irq; return dcp_vmi_irq;
}
dcp_irq = platform_get_irq(pdev, 1); dcp_irq = platform_get_irq(pdev, 1);
if (dcp_irq < 0) { if (dcp_irq < 0)
dev_err(dev, "Failed to get IRQ: (%d)!\n", dcp_irq);
return dcp_irq; return dcp_irq;
}
sdcp = devm_kzalloc(dev, sizeof(*sdcp), GFP_KERNEL); sdcp = devm_kzalloc(dev, sizeof(*sdcp), GFP_KERNEL);
if (!sdcp) if (!sdcp)
......
...@@ -1180,7 +1180,6 @@ static int omap_aes_probe(struct platform_device *pdev) ...@@ -1180,7 +1180,6 @@ static int omap_aes_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0) {
dev_err(dev, "can't get IRQ resource\n");
err = irq; err = irq;
goto err_irq; goto err_irq;
} }
......
...@@ -1049,7 +1049,6 @@ static int omap_des_probe(struct platform_device *pdev) ...@@ -1049,7 +1049,6 @@ static int omap_des_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0) {
dev_err(dev, "can't get IRQ resource: %d\n", irq);
err = irq; err = irq;
goto err_irq; goto err_irq;
} }
......
...@@ -1989,7 +1989,6 @@ static int omap_sham_get_res_pdev(struct omap_sham_dev *dd, ...@@ -1989,7 +1989,6 @@ static int omap_sham_get_res_pdev(struct omap_sham_dev *dd,
/* Get the IRQ */ /* Get the IRQ */
dd->irq = platform_get_irq(pdev, 0); dd->irq = platform_get_irq(pdev, 0);
if (dd->irq < 0) { if (dd->irq < 0) {
dev_err(dev, "no IRQ resource info\n");
err = dd->irq; err = dd->irq;
goto err; goto err;
} }
......
...@@ -1403,10 +1403,8 @@ static int sahara_probe(struct platform_device *pdev) ...@@ -1403,10 +1403,8 @@ static int sahara_probe(struct platform_device *pdev)
/* Get the IRQ */ /* Get the IRQ */
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "failed to get irq resource\n");
return irq; return irq;
}
err = devm_request_irq(&pdev->dev, irq, sahara_irq_handler, err = devm_request_irq(&pdev->dev, irq, sahara_irq_handler,
0, dev_name(&pdev->dev), dev); 0, dev_name(&pdev->dev), dev);
......
...@@ -1975,10 +1975,8 @@ static int stm32_cryp_probe(struct platform_device *pdev) ...@@ -1975,10 +1975,8 @@ static int stm32_cryp_probe(struct platform_device *pdev)
return PTR_ERR(cryp->regs); return PTR_ERR(cryp->regs);
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(dev, "Cannot get IRQ resource\n");
return irq; return irq;
}
ret = devm_request_threaded_irq(dev, irq, stm32_cryp_irq, ret = devm_request_threaded_irq(dev, irq, stm32_cryp_irq,
stm32_cryp_irq_thread, IRQF_ONESHOT, stm32_cryp_irq_thread, IRQF_ONESHOT,
......
...@@ -1450,10 +1450,8 @@ static int stm32_hash_probe(struct platform_device *pdev) ...@@ -1450,10 +1450,8 @@ static int stm32_hash_probe(struct platform_device *pdev)
return ret; return ret;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(dev, "Cannot get IRQ resource\n");
return irq; return irq;
}
ret = devm_request_threaded_irq(dev, irq, stm32_hash_irq_handler, ret = devm_request_threaded_irq(dev, irq, stm32_hash_irq_handler,
stm32_hash_irq_thread, IRQF_ONESHOT, stm32_hash_irq_thread, IRQF_ONESHOT,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment