Skip to content

Commit

Permalink
rtc: remove unnecessary error message after platform_get_irq
Browse files Browse the repository at this point in the history
The function “platform_get_irq” can log an error already.
Thus omit redundant messages for the exception handling in the
calling functions.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <[email protected]>
Acked-by: Vladimir Zapolskiy <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
  • Loading branch information
elfring authored and alexandrebelloni committed Apr 15, 2020
1 parent 8f3d9f3 commit 944ed45
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 1 addition & 3 deletions drivers/rtc/rtc-fsl-ftm-alarm.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,8 @@ static int ftm_rtc_probe(struct platform_device *pdev)
}

irq = platform_get_irq(pdev, 0);
if (irq < 0) {
dev_err(&pdev->dev, "can't get irq number\n");
if (irq < 0)
return irq;
}

ret = devm_request_irq(&pdev->dev, irq, ftm_rtc_alarm_interrupt,
IRQF_NO_SUSPEND, dev_name(&pdev->dev), rtc);
Expand Down
4 changes: 1 addition & 3 deletions drivers/rtc/rtc-lpc24xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,8 @@ static int lpc24xx_rtc_probe(struct platform_device *pdev)
return PTR_ERR(rtc->rtc_base);

irq = platform_get_irq(pdev, 0);
if (irq < 0) {
dev_warn(&pdev->dev, "can't get interrupt resource\n");
if (irq < 0)
return irq;
}

rtc->clk_rtc = devm_clk_get(&pdev->dev, "rtc");
if (IS_ERR(rtc->clk_rtc)) {
Expand Down
4 changes: 1 addition & 3 deletions drivers/rtc/rtc-mt2712.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,8 @@ static int mt2712_rtc_probe(struct platform_device *pdev)
mt2712_rtc_hw_init(mt2712_rtc);

mt2712_rtc->irq = platform_get_irq(pdev, 0);
if (mt2712_rtc->irq < 0) {
dev_err(&pdev->dev, "No IRQ resource\n");
if (mt2712_rtc->irq < 0)
return mt2712_rtc->irq;
}

platform_set_drvdata(pdev, mt2712_rtc);

Expand Down

0 comments on commit 944ed45

Please sign in to comment.