Thread (41 messages) 41 messages, 15 authors, 2015-03-12
STALE4123d

[PATCH 5/8] serial: samsung: fix struct clk pointer comparing

From: Shawn Guo <hidden>
Date: 2015-02-25 14:53:35
Also in: alsa-devel, dri-devel, linux-pwm, linux-serial
Subsystem: arm/samsung s3c, s5p and exynos arm architectures, the rest, tty layer and serial drivers · Maintainers: Krzysztof Kozlowski, Peter Griffin, Linus Torvalds, Greg Kroah-Hartman, Jiri Slaby

Since commit 035a61c314eb ("clk: Make clk API return per-user struct clk
instances"), clk API users can no longer check if two struct clk
pointers are pointing to the same hardware clock, i.e. struct clk_hw, by
simply comparing two pointers.  That's because with the per-user clk
change, a brand new struct clk is created whenever clients try to look
up the clock by calling clk_get() or sister functions like clk_get_sys()
and of_clk_get().  This changes the original behavior where the struct
clk is only created for once when clock driver registers the clock to
CCF in the first place.  The net change here is before commit
035a61c314eb the struct clk pointer is unique for given hardware
clock, while after the commit the pointers returned by clk lookup calls
become different for the same hardware clock.

That said, the struct clk pointer comparing in the code doesn't work any
more.  Call helper function clk_is_match() instead to fix the problem.

Signed-off-by: Shawn Guo <redacted>
---
 drivers/tty/serial/samsung.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index af821a908720..b747066247df 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -1277,7 +1277,7 @@ static void s3c24xx_serial_set_termios(struct uart_port *port,
 
 	/* check to see if we need  to change clock source */
 
-	if (ourport->baudclk != clk) {
+	if (!clk_is_match(ourport->baudclk, clk)) {
 		s3c24xx_serial_setsource(port, clk_sel);
 
 		if (!IS_ERR(ourport->baudclk)) {
-- 
1.9.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help