Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1534a3b3dc1cbab006f0add253be1b095d738b82
Commit:     1534a3b3dc1cbab006f0add253be1b095d738b82
Parent:     1929cb340b74904c130fdf3de3fe5bbedb68a5aa
Author:     dmitry pervushin <[EMAIL PROTECTED]>
AuthorDate: Tue Apr 24 13:41:12 2007 +0900
Committer:  Paul Mundt <[EMAIL PROTECTED]>
CommitDate: Mon May 7 02:11:56 2007 +0000

    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 <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mundt <[EMAIL PROTECTED]>
---
 drivers/serial/sh-sci.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c
index 0a34fa9..e5cf57f 100644
--- a/drivers/serial/sh-sci.c
+++ b/drivers/serial/sh-sci.c
@@ -77,6 +77,9 @@ struct sci_port {
        /* Break timer */
        struct timer_list       break_timer;
        int                     break_flag;
+
+       /* Port clock */
+       struct clk              *clk;
 };
 
 #ifdef CONFIG_SH_KGDB
@@ -955,6 +958,8 @@ static int sci_startup(struct uart_port *port)
        if (s->enable)
                s->enable(port);
 
+       s->clk = clk_get(NULL, "module_clk");
+
        sci_request_irq(s);
        sci_start_tx(port);
        sci_start_rx(port, 1);
@@ -972,6 +977,9 @@ static void sci_shutdown(struct uart_port *port)
 
        if (s->disable)
                s->disable(port);
+
+       clk_put(s->clk);
+       s->clk = NULL;
 }
 
 static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
@@ -990,9 +998,7 @@ static void sci_set_termios(struct uart_port *port, struct 
ktermios *termios,
                default:
                {
 #if defined(CONFIG_SUPERH) && !defined(CONFIG_SUPERH64)
-                       struct clk *clk = clk_get(NULL, "module_clk");
-                       t = SCBRR_VALUE(baud, clk_get_rate(clk));
-                       clk_put(clk);
+                       t = SCBRR_VALUE(baud, clk_get_rate(s->clk));
 #else
                        t = SCBRR_VALUE(baud);
 #endif
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to