Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

serial: sh-sci: Fix module clock refcounting.

This adds the enable/disable hooks for the port clock to sh-sci.

Signed-off-by: dmitry pervushin <dimka@nomadgs.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>

authored by

dmitry pervushin and committed by
Paul Mundt
1534a3b3 1929cb34

+9 -3
+9 -3
drivers/serial/sh-sci.c
··· 77 77 /* Break timer */ 78 78 struct timer_list break_timer; 79 79 int break_flag; 80 + 81 + /* Port clock */ 82 + struct clk *clk; 80 83 }; 81 84 82 85 #ifdef CONFIG_SH_KGDB ··· 958 955 if (s->enable) 959 956 s->enable(port); 960 957 958 + s->clk = clk_get(NULL, "module_clk"); 959 + 961 960 sci_request_irq(s); 962 961 sci_start_tx(port); 963 962 sci_start_rx(port, 1); ··· 977 972 978 973 if (s->disable) 979 974 s->disable(port); 975 + 976 + clk_put(s->clk); 977 + s->clk = NULL; 980 978 } 981 979 982 980 static void sci_set_termios(struct uart_port *port, struct ktermios *termios, ··· 998 990 default: 999 991 { 1000 992 #if defined(CONFIG_SUPERH) && !defined(CONFIG_SUPERH64) 1001 - struct clk *clk = clk_get(NULL, "module_clk"); 1002 - t = SCBRR_VALUE(baud, clk_get_rate(clk)); 1003 - clk_put(clk); 993 + t = SCBRR_VALUE(baud, clk_get_rate(s->clk)); 1004 994 #else 1005 995 t = SCBRR_VALUE(baud); 1006 996 #endif