Skip to contentSkip to conversation

clocksource: asm9260: Add a check for of_clk_get

PATCH Applied Chuhong Yuan 2 participants 2 messages Oct 16, 2019 – Nov 4, 2019

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

PATCH 1/1 clocksource: asm9260: Add a check for of_clk_get

asm9260_timer_init misses a check for of_clk_get.
Add a check for it and print errors like other clocksource drivers.

---
 drivers/clocksource/asm9260_timer.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/clocksource/asm9260_timer.c +4 -0
index 9f09a59161e7..5b39d3701fa3 100644
@@ -194,6 +194,10 @@ static int __init asm9260_timer_init(struct device_node *np)
 	}
 
 	clk = of_clk_get(np, 0);
+	if (IS_ERR(clk)) {
+		pr_err("Failed to get clk!\n");
+		return PTR_ERR(clk);
+	}
 
 	ret = clk_prepare_enable(clk);
 	if (ret) {
Signature · 1 line
2.20.1
merge bot Applied
#1 lore raw

[tip: timers/core] clocksource/drivers/asm9260: Add a check for of_clk_get

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:     6e001f6a4cc73cd06fc7b8c633bc4906c33dd8ad
Gitweb:        https://git.kernel.org/tip/6e001f6a4cc73cd06fc7b8c633bc4906c33dd8ad
Author:        Chuhong Yuan <[email protected]>
AuthorDate:    Wed, 16 Oct 2019 20:43:30 +08:00
Committer:     Daniel Lezcano <[email protected]>
CommitterDate: Mon, 04 Nov 2019 10:40:10 +01:00

clocksource/drivers/asm9260: Add a check for of_clk_get

asm9260_timer_init misses a check for of_clk_get.
Add a check for it and print errors like other clocksource drivers.

---
 drivers/clocksource/asm9260_timer.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/clocksource/asm9260_timer.c +4 -0
index 9f09a59..5b39d37 100644
@@ -194,6 +194,10 @@ static int __init asm9260_timer_init(struct device_node *np)
 	}
 
 	clk = of_clk_get(np, 0);
+	if (IS_ERR(clk)) {
+		pr_err("Failed to get clk!\n");
+		return PTR_ERR(clk);
+	}
 
 	ret = clk_prepare_enable(clk);
 	if (ret) {