aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2007-04-25 22:45:32 -0400
committerPaul Mundt <lethal@hera.kernel.org>2007-05-06 22:11:56 -0400
commit005a336e71e9e3ea356f9afca5d66318d6901319 (patch)
tree90e220ade282cc8b1cb0450e79c53707ce109221
parent1534a3b3dc1cbab006f0add253be1b095d738b82 (diff)
serial: sh-sci: Fix module clock refcount for serial console.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r--drivers/serial/sh-sci.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c
index e5cf57f482cf..1f89496d530e 100644
--- a/drivers/serial/sh-sci.c
+++ b/drivers/serial/sh-sci.c
@@ -78,8 +78,10 @@ struct sci_port {
78 struct timer_list break_timer; 78 struct timer_list break_timer;
79 int break_flag; 79 int break_flag;
80 80
81#if defined(CONFIG_SUPERH) && !defined(CONFIG_SUPERH64)
81 /* Port clock */ 82 /* Port clock */
82 struct clk *clk; 83 struct clk *clk;
84#endif
83}; 85};
84 86
85#ifdef CONFIG_SH_KGDB 87#ifdef CONFIG_SH_KGDB
@@ -958,7 +960,9 @@ static int sci_startup(struct uart_port *port)
958 if (s->enable) 960 if (s->enable)
959 s->enable(port); 961 s->enable(port);
960 962
963#if defined(CONFIG_SUPERH) && !defined(CONFIG_SUPERH64)
961 s->clk = clk_get(NULL, "module_clk"); 964 s->clk = clk_get(NULL, "module_clk");
965#endif
962 966
963 sci_request_irq(s); 967 sci_request_irq(s);
964 sci_start_tx(port); 968 sci_start_tx(port);
@@ -978,8 +982,10 @@ static void sci_shutdown(struct uart_port *port)
978 if (s->disable) 982 if (s->disable)
979 s->disable(port); 983 s->disable(port);
980 984
985#if defined(CONFIG_SUPERH) && !defined(CONFIG_SUPERH64)
981 clk_put(s->clk); 986 clk_put(s->clk);
982 s->clk = NULL; 987 s->clk = NULL;
988#endif
983} 989}
984 990
985static void sci_set_termios(struct uart_port *port, struct ktermios *termios, 991static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
@@ -1231,6 +1237,11 @@ static int __init serial_console_setup(struct console *co, char *options)
1231 1237
1232 port->type = serial_console_port->type; 1238 port->type = serial_console_port->type;
1233 1239
1240#if defined(CONFIG_SUPERH) && !defined(CONFIG_SUPERH64)
1241 if (!serial_console_port->clk)
1242 serial_console_port->clk = clk_get(NULL, "module_clk");
1243#endif
1244
1234 if (port->flags & UPF_IOREMAP) 1245 if (port->flags & UPF_IOREMAP)
1235 sci_config_port(port, 0); 1246 sci_config_port(port, 0);
1236 1247