aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/amba-pl010.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-09-22 06:35:09 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-09-27 04:25:52 -0400
commit36b8f1e2dc8d0da4571788053af70f1f45d96ecf (patch)
tree214a7e1304e8065a6a7b486480b97e60ed5742df /drivers/tty/serial/amba-pl010.c
parent99df4ee107a85530f3d4f6d628c8a86db9b1a8b3 (diff)
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)
312 struct uart_amba_port *uap = (struct uart_amba_port *)port; 312 struct uart_amba_port *uap = (struct uart_amba_port *)port;
313 int retval; 313 int retval;
314 314
315 retval = clk_prepare(uap->clk);
316 if (retval)
317 goto out;
318
315 /* 319 /*
316 * Try to enable the clock producer. 320 * Try to enable the clock producer.
317 */ 321 */
318 retval = clk_enable(uap->clk); 322 retval = clk_enable(uap->clk);
319 if (retval) 323 if (retval)
320 goto out; 324 goto clk_unprep;
321 325
322 uap->port.uartclk = clk_get_rate(uap->clk); 326 uap->port.uartclk = clk_get_rate(uap->clk);
323 327
@@ -343,6 +347,8 @@ static int pl010_startup(struct uart_port *port)
343 347
344 clk_dis: 348 clk_dis:
345 clk_disable(uap->clk); 349 clk_disable(uap->clk);
350 clk_unprep:
351 clk_unprepare(uap->clk);
346 out: 352 out:
347 return retval; 353 return retval;
348} 354}
@@ -370,6 +376,7 @@ static void pl010_shutdown(struct uart_port *port)
370 * Shut down the clock producer 376 * Shut down the clock producer
371 */ 377 */
372 clk_disable(uap->clk); 378 clk_disable(uap->clk);
379 clk_unprepare(uap->clk);
373} 380}
374 381
375static void 382static void
@@ -626,6 +633,7 @@ static int __init pl010_console_setup(struct console *co, char *options)
626 int bits = 8; 633 int bits = 8;
627 int parity = 'n'; 634 int parity = 'n';
628 int flow = 'n'; 635 int flow = 'n';
636 int ret;
629 637
630 /* 638 /*
631 * Check whether an invalid uart number has been specified, and 639 * 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 if (!uap) 646 if (!uap)
639 return -ENODEV; 647 return -ENODEV;
640 648
649 ret = clk_prepare(uap->clk);
650 if (ret)
651 return ret;
652
641 uap->port.uartclk = clk_get_rate(uap->clk); 653 uap->port.uartclk = clk_get_rate(uap->clk);
642 654
643 if (options) 655 if (options)