| From | Stephen Boyd <> | Subject | [PATCH v6 26/57] memory: Remove dev_err() usage after platform_get_irq() | Date | Tue, 30 Jul 2019 11:15:26 -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: Dmitry Osipenko <digetx@gmail.com> Cc: Thierry Reding <treding@nvidia.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Joerg Roedel <jroedel@suse.de> Cc: Markus Mayer <mmayer@broadcom.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Cc: Paul Cercueil <paul@crapouillou.net> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Stephen Boyd <swboyd@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
|