diff options
author | Yi Zhang <yizhang@marvell.com> | 2013-01-23 02:52:25 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-25 17:52:23 +0100 |
commit | 9429ccbf386c9fce9d998a96474a0926391208cf (patch) | |
tree | 11d8315f1e2be9019d123e9e88aaaa32580f1cad | |
parent | serial: pch_uart: fix sysrq handling for pch_uart (diff) | |
download | linux-9429ccbf386c9fce9d998a96474a0926391208cf.tar.xz linux-9429ccbf386c9fce9d998a96474a0926391208cf.zip |
serial: pxa: fine-tune clk useage
1) add clk_enable/disable in serial_pxa_console_write()
2) add clk_prepare() to follow common clock driver
Signed-off-by: Yi Zhang <yizhang@marvell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/pxa.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c index a67f9e156ada..05f504e0c271 100644 --- a/drivers/tty/serial/pxa.c +++ b/drivers/tty/serial/pxa.c @@ -672,7 +672,7 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count) unsigned long flags; int locked = 1; - + clk_enable(up->clk); local_irq_save(flags); if (up->port.sysrq) locked = 0; @@ -699,6 +699,7 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count) if (locked) spin_unlock(&up->port.lock); local_irq_restore(flags); + clk_disable(up->clk); } @@ -896,6 +897,12 @@ static int serial_pxa_probe(struct platform_device *dev) goto err_free; } + ret = clk_prepare(sport->clk); + if (ret) { + clk_put(sport->clk); + goto err_free; + } + sport->port.type = PORT_PXA; sport->port.iotype = UPIO_MEM; sport->port.mapbase = mmres->start; @@ -927,6 +934,7 @@ static int serial_pxa_probe(struct platform_device *dev) return 0; err_clk: + clk_unprepare(sport->clk); clk_put(sport->clk); err_free: kfree(sport); @@ -940,6 +948,8 @@ static int serial_pxa_remove(struct platform_device *dev) platform_set_drvdata(dev, NULL); uart_remove_one_port(&serial_pxa_reg, &sport->port); + + clk_unprepare(sport->clk); clk_put(sport->clk); kfree(sport); |