Skip to contentSkip to conversation

rtc: Delete an error message in three functions

PATCH In review Markus Elfring 2 participants 2 messages Apr 5, 2020

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc: Delete an error message in three functions

From: Markus Elfring <[email protected]>
Date: Sun, 5 Apr 2020 17:30:15 +0200

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.

---
 drivers/rtc/rtc-fsl-ftm-alarm.c | 4 +---
 drivers/rtc/rtc-lpc24xx.c       | 4 +---
 drivers/rtc/rtc-mt2712.c        | 4 +---
 3 files changed, 3 insertions(+), 9 deletions(-)
drivers/rtc/rtc-fsl-ftm-alarm.c +1 -3
index 756af62b0486..23c811da4801 100644
@@ -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);
drivers/rtc/rtc-lpc24xx.c +1 -3
index 00ef16ba9480..eec881a81067 100644
@@ -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)) {
drivers/rtc/rtc-mt2712.c +1 -3
index 581b8731fb8a..f6bdbabd7202 100644
@@ -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);
 

--
2.26.0

maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Markus Elfring

From: Markus Elfring <[email protected]>
Date: Sun, 5 Apr 2020 17:30:15 +0200

The function “platform_get_irq” can log an error already. Thus omit redundant messages for the exception handling in the calling functions.

Quoted 6 lines

This issue was detected by using the Coccinelle software.

---
 drivers/rtc/rtc-fsl-ftm-alarm.c | 4 +---
 drivers/rtc/rtc-lpc24xx.c       | 4 +---

For LPC24xx/18xx/43xx change

Quoted 3 lines
 drivers/rtc/rtc-mt2712.c        | 4 +---
 3 files changed, 3 insertions(+), 9 deletions(-)

--
Best wishes,
Vladimir