| From | Stephen Boyd <> | Subject | [PATCH v6 11/57] edac: Remove dev_err() usage after platform_get_irq() | Date | Tue, 30 Jul 2019 11:15:11 -0700 |
| |
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: Borislav Petkov <bp@alien8.de> Cc: Mauro Carvalho Chehab <mchehab@kernel.org> Cc: James Morse <james.morse@arm.com> Cc: linux-edac@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Stephen Boyd <swboyd@chromium.org> ---
Please apply directly to subsystem trees
drivers/edac/altera_edac.c | 13 +++---------- drivers/edac/xgene_edac.c | 1 - 2 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c index c2e693e34d43..5405bd727731 100644 --- a/drivers/edac/altera_edac.c +++ b/drivers/edac/altera_edac.c @@ -347,11 +347,8 @@ static int altr_sdram_probe(struct platform_device *pdev) } irq = platform_get_irq(pdev, 0); - if (irq < 0) { - edac_printk(KERN_ERR, EDAC_MC, - "No irq %d in DT\n", irq); + if (irq < 0) return -ENODEV; - } /* Arria10 has a 2nd IRQ */ irq2 = platform_get_irq(pdev, 1); @@ -2177,10 +2174,8 @@ static int altr_edac_a10_probe(struct platform_device *pdev) } edac->sb_irq = platform_get_irq(pdev, 0); - if (edac->sb_irq < 0) { - dev_err(&pdev->dev, "No SBERR IRQ resource\n"); + if (edac->sb_irq < 0) return edac->sb_irq; - } irq_set_chained_handler_and_data(edac->sb_irq, altr_edac_a10_irq_handler, @@ -2212,10 +2207,8 @@ static int altr_edac_a10_probe(struct platform_device *pdev) } #else edac->db_irq = platform_get_irq(pdev, 1); - if (edac->db_irq < 0) { - dev_err(&pdev->dev, "No DBERR IRQ resource\n"); + if (edac->db_irq < 0) return edac->db_irq; - } irq_set_chained_handler_and_data(edac->db_irq, altr_edac_a10_irq_handler, edac); #endif diff --git a/drivers/edac/xgene_edac.c b/drivers/edac/xgene_edac.c index e4a1032ba0b5..cb26ce5d5798 100644 --- a/drivers/edac/xgene_edac.c +++ b/drivers/edac/xgene_edac.c @@ -1921,7 +1921,6 @@ static int xgene_edac_probe(struct platform_device *pdev) for (i = 0; i < 3; i++) { irq = platform_get_irq(pdev, i); if (irq < 0) { - dev_err(&pdev->dev, "No IRQ resource\n"); rc = -EINVAL; goto out_err; } -- Sent by a computer through tubes
|