Skip to contentSkip to conversation

clocksource/h8300_timer8: Fix wrong return value in h8300_8timer_init()

PATCH Applied Tianjia Zhang 3 participants 3 messages Aug 2, 2020 – Sep 27, 2020 Clocksource, clockevent drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clocksource/h8300_timer8: Fix wrong return value in h8300_8timer_init()

In the case of calling of_iomap() failed, a positive value ENXIO is returned here. I think this is a typo error. It is necessary to return a negative error value.

Fixes 691f8f878290f ("clocksource/drivers/h8300_timer8: Convert init function to return error")
Cc Daniel Lezcano <[email protected]>
---
 drivers/clocksource/h8300_timer8.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/h8300_timer8.c +1 -1
index 1d740a8c42ab..47114c2a7cb5 100644
@@ -169,7 +169,7 @@ static int __init h8300_8timer_init(struct device_node *node)
 		return PTR_ERR(clk);
 	}
 
-	ret = ENXIO;
+	ret = -ENXIO;
 	base = of_iomap(node, 0);
 	if (!base) {
 		pr_err("failed to map registers for clockevent\n");
Signature · 1 line
2.26.2
#1 lore raw
Quoted 3 lines · Tianjia Zhang

In the case of calling of_iomap() failed, a positive value ENXIO is returned here. I think this is a typo error. It is necessary to return a negative error value.

Yes, it is.

Applied, thanks for the fix.

-- Daniel

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
#2 lore raw

[tip: timers/urgent] clocksource/drivers/h8300_timer8: Fix wrong return value in h8300_8timer_init()

In reply to Tianjia Zhang
The following commit has been merged into the timers/urgent branch of tip:

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

Commit-ID:     400d033f5a599120089b5f0c54d14d198499af5a
Gitweb:        https://git.kernel.org/tip/400d033f5a599120089b5f0c54d14d198499af5a
Author:        Tianjia Zhang <[email protected]>
AuthorDate:    Sun, 02 Aug 2020 19:15:41 +08:00
Committer:     Daniel Lezcano <[email protected]>
CommitterDate: Mon, 24 Aug 2020 13:01:38 +02:00

clocksource/drivers/h8300_timer8: Fix wrong return value in h8300_8timer_init()

In the init function, if the call to of_iomap() fails, the return value is ENXIO instead of -ENXIO.

Change to the right negative errno.

Fixes 691f8f878290f ("clocksource/drivers/h8300_timer8: Convert init function to return error")
Cc Daniel Lezcano <[email protected]>
---
 drivers/clocksource/h8300_timer8.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/h8300_timer8.c +1 -1
index 1d740a8..47114c2 100644
@@ -169,7 +169,7 @@ static int __init h8300_8timer_init(struct device_node *node)
 		return PTR_ERR(clk);
 	}
 
-	ret = ENXIO;
+	ret = -ENXIO;
 	base = of_iomap(node, 0);
 	if (!base) {
 		pr_err("failed to map registers for clockevent\n");