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: Russell King <li...@armlinux.org.uk> Cc: Shawn Guo <shawn...@kernel.org> Cc: Tony Lindgren <t...@atomide.com> Cc: Maxime Ripard <maxime.rip...@bootlin.com> Cc: Simon Horman <horms+rene...@verge.net.au> Cc: Chen-Yu Tsai <w...@csie.org> Cc: linux-arm-ker...@lists.infradead.org Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org> Signed-off-by: Stephen Boyd <swb...@chromium.org> --- Please apply directly to subsystem trees arch/arm/plat-omap/dma.c | 1 - arch/arm/plat-pxa/ssp.c | 5 ++--- arch/arm/plat-samsung/adc.c | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index 79f43acf9acb..9386b2e9b332 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c @@ -1371,7 +1371,6 @@ static int omap_system_dma_probe(struct platform_device *pdev) strcpy(irq_name, "0"); dma_irq = platform_get_irq_byname(pdev, irq_name); if (dma_irq < 0) { - dev_err(&pdev->dev, "failed: request IRQ %d", dma_irq); ret = dma_irq; goto exit_dma_lch_fail; } diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c index 9a6e4923bd69..88b5dd99f6bc 100644 --- a/arch/arm/plat-pxa/ssp.c +++ b/arch/arm/plat-pxa/ssp.c @@ -146,10 +146,9 @@ static int pxa_ssp_probe(struct platform_device *pdev) } ssp->irq = platform_get_irq(pdev, 0); - if (ssp->irq < 0) { - dev_err(dev, "no IRQ resource defined\n"); + if (ssp->irq < 0) return -ENODEV; - } + if (dev->of_node) { const struct of_device_id *id = diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c index ee3d5c989a76..4bbeca3cbd9e 100644 --- a/arch/arm/plat-samsung/adc.c +++ b/arch/arm/plat-samsung/adc.c @@ -354,10 +354,8 @@ static int s3c_adc_probe(struct platform_device *pdev) } adc->irq = platform_get_irq(pdev, 1); - if (adc->irq <= 0) { - dev_err(dev, "failed to get adc irq\n"); + if (adc->irq <= 0) return -ENOENT; - } ret = devm_request_irq(dev, adc->irq, s3c_adc_irq, 0, dev_name(dev), adc); -- Sent by a computer through tubes