summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/amba-pl010.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-09-22 11:35:09 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-09-27 09:25:52 +0100
commit36b8f1e2dc8d0da4571788053af70f1f45d96ecf (patch)
tree214a7e1304e8065a6a7b486480b97e60ed5742df /drivers/tty/serial/amba-pl010.c
parent99df4ee107a85530f3d4f6d628c8a86db9b1a8b3 (diff)
downloadblackbird-op-linux-36b8f1e2dc8d0da4571788053af70f1f45d96ecf.tar.gz
blackbird-op-linux-36b8f1e2dc8d0da4571788053af70f1f45d96ecf.zip
clk: amba-pl010: convert to clk_prepare()/clk_unprepare()
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/tty/serial/amba-pl010.c')
-rw-r--r--drivers/tty/serial/amba-pl010.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/tty/serial/amba-pl010.c b/drivers/tty/serial/amba-pl010.c
index c0d10c4ddb73..efdf92c3a352 100644
--- a/drivers/tty/serial/amba-pl010.c
+++ b/drivers/tty/serial/amba-pl010.c
@@ -312,12 +312,16 @@ static int pl010_startup(struct uart_port *port)
struct uart_amba_port *uap = (struct uart_amba_port *)port;
int retval;
+ retval = clk_prepare(uap->clk);
+ if (retval)
+ goto out;
+
/*
* Try to enable the clock producer.
*/
retval = clk_enable(uap->clk);
if (retval)
- goto out;
+ goto clk_unprep;
uap->port.uartclk = clk_get_rate(uap->clk);
@@ -343,6 +347,8 @@ static int pl010_startup(struct uart_port *port)
clk_dis:
clk_disable(uap->clk);
+ clk_unprep:
+ clk_unprepare(uap->clk);
out:
return retval;
}
@@ -370,6 +376,7 @@ static void pl010_shutdown(struct uart_port *port)
* Shut down the clock producer
*/
clk_disable(uap->clk);
+ clk_unprepare(uap->clk);
}
static void
@@ -626,6 +633,7 @@ static int __init pl010_console_setup(struct console *co, char *options)
int bits = 8;
int parity = 'n';
int flow = 'n';
+ int ret;
/*
* Check whether an invalid uart number has been specified, and
@@ -638,6 +646,10 @@ static int __init pl010_console_setup(struct console *co, char *options)
if (!uap)
return -ENODEV;
+ ret = clk_prepare(uap->clk);
+ if (ret)
+ return ret;
+
uap->port.uartclk = clk_get_rate(uap->clk);
if (options)
OpenPOWER on IntegriCloud