Skip to contentSkip to conversation

clocksource/drivers/sun5i: Remove surplus dev_err() when using platform_get_irq()

PATCH Applied Yang Li 4 participants 4 messages Aug 31, 2023 – Oct 27, 2023

Subsystems (2)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 clocksource/drivers/sun5i: Remove surplus dev_err() when using platform_get_irq()

There is no need to call the dev_err() function directly to print a custom message when handling an error from either the platform_get_irq() or platform_get_irq_byname() functions as both are going to display an appropriate error message in case of a failure.

./drivers/clocksource/timer-sun5i.c:260:2-9: line 260 is redundant because platform_get_irq() already prints an error

---
 drivers/clocksource/timer-sun5i.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/clocksource/timer-sun5i.c +1 -3
index 69fee3540d37..0d229a9058da 100644
@@ -256,10 +256,8 @@ static int sun5i_timer_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(dev, "Can't get IRQ\n");
+	if (irq < 0)
 		return irq;
-	}
 
 	clk = devm_clk_get_enabled(dev, NULL);
 	if (IS_ERR(clk)) {
Signature · 1 line
2.20.1.7.g153144c
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · CEST Yang Li

There is no need to call the dev_err() function directly to print a custom message when handling an error from either the platform_get_irq() or platform_get_irq_byname() functions as both are going to display an appropriate error message in case of a failure.

./drivers/clocksource/timer-sun5i.c:260:2-9: line 260 is redundant because platform_get_irq() already prints an error

Best regards,
Jernej

Quoted 20 lines
---
 drivers/clocksource/timer-sun5i.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
(quoted diff) +0 -0

b/drivers/clocksource/timer-sun5i.c index 69fee3540d37..0d229a9058da 100644

drivers/clocksource/timer-sun5i.c +1 -3
@@ -256,10 +256,8 @@ static int sun5i_timer_probe(struct platform_device
 *pdev) }
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(dev, "Can't get IRQ\n");
+	if (irq < 0)
 		return irq;
-	}
 
 	clk = devm_clk_get_enabled(dev, NULL);
 	if (IS_ERR(clk)) {
#2 lore raw
In reply to Yang Li
Quoted 9 lines · Yang Li

There is no need to call the dev_err() function directly to print a custom message when handling an error from either the platform_get_irq() or platform_get_irq_byname() functions as both are going to display an appropriate error message in case of a failure.

./drivers/clocksource/timer-sun5i.c:260:2-9: line 260 is redundant because platform_get_irq() already prints an error

---

Applied, thanks

Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
merge bot Applied
#3 lore raw
In reply to Yang Li
The following commit has been merged into the timers/core branch of tip:

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     fd73c011a123a66d88998f356c920d33d87524cf
Gitweb:        https://git.kernel.org/tip/fd73c011a123a66d88998f356c920d33d87524cf
Author:        Yang Li <[email protected]>
AuthorDate:    Thu, 31 Aug 2023 12:14:14 +08:00
Committer:     Daniel Lezcano <[email protected]>
CommitterDate: Wed, 11 Oct 2023 12:06:41 +02:00

clocksource/drivers/sun5i: Remove surplus dev_err() when using platform_get_irq()

There is no need to call the dev_err() function directly to print a custom message when handling an error from either the platform_get_irq() or platform_get_irq_byname() functions as both are going to display an appropriate error message in case of a failure.

./drivers/clocksource/timer-sun5i.c:260:2-9: line 260 is redundant because platform_get_irq() already prints an error

---
 drivers/clocksource/timer-sun5i.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/clocksource/timer-sun5i.c +1 -3
index 69fee35..0d229a9 100644
@@ -256,10 +256,8 @@ static int sun5i_timer_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(dev, "Can't get IRQ\n");
+	if (irq < 0)
 		return irq;
-	}
 
 	clk = devm_clk_get_enabled(dev, NULL);
 	if (IS_ERR(clk)) {