Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clocksource: 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: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

authored by

Stephen Boyd and committed by
Daniel Lezcano
9f475d08 3e2d9453

+3 -11
+1 -3
drivers/clocksource/em_sti.c
··· 291 291 platform_set_drvdata(pdev, p); 292 292 293 293 irq = platform_get_irq(pdev, 0); 294 - if (irq < 0) { 295 - dev_err(&pdev->dev, "failed to get irq\n"); 294 + if (irq < 0) 296 295 return irq; 297 - } 298 296 299 297 /* map memory, let base point to the STI instance */ 300 298 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+1 -4
drivers/clocksource/sh_cmt.c
··· 776 776 int ret; 777 777 778 778 irq = platform_get_irq(ch->cmt->pdev, ch->index); 779 - if (irq < 0) { 780 - dev_err(&ch->cmt->pdev->dev, "ch%u: failed to get irq\n", 781 - ch->index); 779 + if (irq < 0) 782 780 return irq; 783 - } 784 781 785 782 ret = request_irq(irq, sh_cmt_interrupt, 786 783 IRQF_TIMER | IRQF_IRQPOLL | IRQF_NOBALANCING,
+1 -4
drivers/clocksource/sh_tmu.c
··· 462 462 ch->base = tmu->mapbase + 8 + ch->index * 12; 463 463 464 464 ch->irq = platform_get_irq(tmu->pdev, index); 465 - if (ch->irq < 0) { 466 - dev_err(&tmu->pdev->dev, "ch%u: failed to get irq\n", 467 - ch->index); 465 + if (ch->irq < 0) 468 466 return ch->irq; 469 - } 470 467 471 468 ch->cs_enabled = false; 472 469 ch->enable_count = 0;