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: Dmitry Osipenko <dig...@gmail.com> Cc: Thierry Reding <tred...@nvidia.com> Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org> Cc: Joerg Roedel <jroe...@suse.de> Cc: Markus Mayer <mma...@broadcom.com> Cc: Thomas Gleixner <t...@linutronix.de> Cc: Masahiro Yamada <yamada.masah...@socionext.com> Cc: Paul Cercueil <p...@crapouillou.net> Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org> Signed-off-by: Stephen Boyd <swb...@chromium.org> --- Please apply directly to subsystem trees drivers/memory/emif.c | 5 +---- drivers/memory/tegra/mc.c | 4 +--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/memory/emif.c b/drivers/memory/emif.c index 402c6bc8e621..f021687ecc5c 100644 --- a/drivers/memory/emif.c +++ b/drivers/memory/emif.c @@ -1563,11 +1563,8 @@ static int __init_or_module emif_probe(struct platform_device *pdev) goto error; irq = platform_get_irq(pdev, 0); - if (irq < 0) { - dev_err(emif->dev, "%s: error getting IRQ resource - %d\n", - __func__, irq); + if (irq < 0) goto error; - } emif_onetime_settings(emif); emif_debugfs_init(emif); diff --git a/drivers/memory/tegra/mc.c b/drivers/memory/tegra/mc.c index 3d8d322511c5..851983c67fc1 100644 --- a/drivers/memory/tegra/mc.c +++ b/drivers/memory/tegra/mc.c @@ -677,10 +677,8 @@ static int tegra_mc_probe(struct platform_device *pdev) } mc->irq = platform_get_irq(pdev, 0); - if (mc->irq < 0) { - dev_err(&pdev->dev, "interrupt not specified\n"); + if (mc->irq < 0) return mc->irq; - } WARN(!mc->soc->client_id_mask, "missing client ID mask for this SoC\n"); -- Sent by a computer through tubes