aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-09-22 06:35:30 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-09-27 04:25:52 -0400
commit4b4851c65d926f46e208e4731409022d986a1355 (patch)
treef8decc7de5d5db8744c26f27749d42f2e6644429 /drivers/tty
parent36b8f1e2dc8d0da4571788053af70f1f45d96ecf (diff)
clk: amba-pl011: convert to clk_prepare()/clk_unprepare()
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/amba-pl011.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index f5f6831b0a64..00233af1acc4 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -1367,12 +1367,16 @@ static int pl011_startup(struct uart_port *port)
1367 unsigned int cr; 1367 unsigned int cr;
1368 int retval; 1368 int retval;
1369 1369
1370 retval = clk_prepare(uap->clk);
1371 if (retval)
1372 goto out;
1373
1370 /* 1374 /*
1371 * Try to enable the clock producer. 1375 * Try to enable the clock producer.
1372 */ 1376 */
1373 retval = clk_enable(uap->clk); 1377 retval = clk_enable(uap->clk);
1374 if (retval) 1378 if (retval)
1375 goto out; 1379 goto clk_unprep;
1376 1380
1377 uap->port.uartclk = clk_get_rate(uap->clk); 1381 uap->port.uartclk = clk_get_rate(uap->clk);
1378 1382
@@ -1446,6 +1450,8 @@ static int pl011_startup(struct uart_port *port)
1446 1450
1447 clk_dis: 1451 clk_dis:
1448 clk_disable(uap->clk); 1452 clk_disable(uap->clk);
1453 clk_unprep:
1454 clk_unprepare(uap->clk);
1449 out: 1455 out:
1450 return retval; 1456 return retval;
1451} 1457}
@@ -1497,6 +1503,7 @@ static void pl011_shutdown(struct uart_port *port)
1497 * Shut down the clock producer 1503 * Shut down the clock producer
1498 */ 1504 */
1499 clk_disable(uap->clk); 1505 clk_disable(uap->clk);
1506 clk_unprepare(uap->clk);
1500 1507
1501 if (uap->port.dev->platform_data) { 1508 if (uap->port.dev->platform_data) {
1502 struct amba_pl011_data *plat; 1509 struct amba_pl011_data *plat;
@@ -1800,6 +1807,7 @@ static int __init pl011_console_setup(struct console *co, char *options)
1800 int bits = 8; 1807 int bits = 8;
1801 int parity = 'n'; 1808 int parity = 'n';
1802 int flow = 'n'; 1809 int flow = 'n';
1810 int ret;
1803 1811
1804 /* 1812 /*
1805 * Check whether an invalid uart number has been specified, and 1813 * 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)
1812 if (!uap) 1820 if (!uap)
1813 return -ENODEV; 1821 return -ENODEV;
1814 1822
1823 ret = clk_prepare(uap->clk);
1824 if (ret)
1825 return ret;
1826
1815 if (uap->port.dev->platform_data) { 1827 if (uap->port.dev->platform_data) {
1816 struct amba_pl011_data *plat; 1828 struct amba_pl011_data *plat;
1817 1829