Thread (5 messages) 5 messages, 3 authors, 2017-07-19
STALE3259d

[PATCH 1/9] ARM: ep93xx: allow NULL clock for clk_get_rate

From: jonas.gorski@gmail.com (Jonas Gorski)
Date: 2017-07-18 10:17:44
Also in: lkml
Subsystem: arm port, arm/cirrus logic ep93xx arm architecture, the rest · Maintainers: Russell King, Hartley Sweeten, Alexander Sverdlin, Nikita Shubin, Linus Torvalds

Make the behaviour of clk_get_rate consistent with common clk's
clk_get_rate by accepting NULL clocks as parameter. Some device
drivers rely on this, and will cause an OOPS otherwise.

Fixes: 1d81eedb8f6c ("[ARM] 3634/1: ep93xx: initial implementation of the clk_* API")
Cc: Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
Reported-by: Mathias Kresin <redacted>
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
 arch/arm/mach-ep93xx/clock.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/arch/arm/mach-ep93xx/clock.c b/arch/arm/mach-ep93xx/clock.c
index 39ef3b613912..f0768befafe8 100644
--- a/arch/arm/mach-ep93xx/clock.c
+++ b/arch/arm/mach-ep93xx/clock.c
@@ -316,6 +316,9 @@ static unsigned long get_uart_rate(struct clk *clk)
 
 unsigned long clk_get_rate(struct clk *clk)
 {
+	if (!clk)
+		return 0;
+
 	if (clk->get_rate)
 		return clk->get_rate(clk);
 
-- 
2.11.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help