clk: amba-pl011: convert to clk_prepare()/clk_unprepare()
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
36b8f1e2dc
commit
4b4851c65d
|
@ -1367,12 +1367,16 @@ static int pl011_startup(struct uart_port *port)
|
||||||
unsigned int cr;
|
unsigned int cr;
|
||||||
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);
|
||||||
|
|
||||||
|
@ -1446,6 +1450,8 @@ static int pl011_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;
|
||||||
}
|
}
|
||||||
|
@ -1497,6 +1503,7 @@ static void pl011_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);
|
||||||
|
|
||||||
if (uap->port.dev->platform_data) {
|
if (uap->port.dev->platform_data) {
|
||||||
struct amba_pl011_data *plat;
|
struct amba_pl011_data *plat;
|
||||||
|
@ -1800,6 +1807,7 @@ static int __init pl011_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
|
||||||
|
@ -1812,6 +1820,10 @@ static int __init pl011_console_setup(struct console *co, char *options)
|
||||||
if (!uap)
|
if (!uap)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
|
ret = clk_prepare(uap->clk);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
if (uap->port.dev->platform_data) {
|
if (uap->port.dev->platform_data) {
|
||||||
struct amba_pl011_data *plat;
|
struct amba_pl011_data *plat;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue