Commit 36b8f1e2 authored by Russell King's avatar Russell King

clk: amba-pl010: convert to clk_prepare()/clk_unprepare()

Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 99df4ee1
...@@ -312,12 +312,16 @@ static int pl010_startup(struct uart_port *port) ...@@ -312,12 +312,16 @@ static int pl010_startup(struct uart_port *port)
struct uart_amba_port *uap = (struct uart_amba_port *)port; struct uart_amba_port *uap = (struct uart_amba_port *)port;
int retval; int retval;
retval = clk_prepare(uap->clk);
if (retval)
goto out;
/* /*
* Try to enable the clock producer. * Try to enable the clock producer.
*/ */
retval = clk_enable(uap->clk); retval = clk_enable(uap->clk);
if (retval) if (retval)
goto out; goto clk_unprep;
uap->port.uartclk = clk_get_rate(uap->clk); uap->port.uartclk = clk_get_rate(uap->clk);
...@@ -343,6 +347,8 @@ static int pl010_startup(struct uart_port *port) ...@@ -343,6 +347,8 @@ static int pl010_startup(struct uart_port *port)
clk_dis: clk_dis:
clk_disable(uap->clk); clk_disable(uap->clk);
clk_unprep:
clk_unprepare(uap->clk);
out: out:
return retval; return retval;
} }
...@@ -370,6 +376,7 @@ static void pl010_shutdown(struct uart_port *port) ...@@ -370,6 +376,7 @@ static void pl010_shutdown(struct uart_port *port)
* Shut down the clock producer * Shut down the clock producer
*/ */
clk_disable(uap->clk); clk_disable(uap->clk);
clk_unprepare(uap->clk);
} }
static void static void
...@@ -626,6 +633,7 @@ static int __init pl010_console_setup(struct console *co, char *options) ...@@ -626,6 +633,7 @@ static int __init pl010_console_setup(struct console *co, char *options)
int bits = 8; int bits = 8;
int parity = 'n'; int parity = 'n';
int flow = 'n'; int flow = 'n';
int ret;
/* /*
* Check whether an invalid uart number has been specified, and * 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) ...@@ -638,6 +646,10 @@ static int __init pl010_console_setup(struct console *co, char *options)
if (!uap) if (!uap)
return -ENODEV; return -ENODEV;
ret = clk_prepare(uap->clk);
if (ret)
return ret;
uap->port.uartclk = clk_get_rate(uap->clk); uap->port.uartclk = clk_get_rate(uap->clk);
if (options) if (options)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment