All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] serial: pxa: fix clk_prepare/unprepare misuse
@ 2013-01-22  3:24 Yi Zhang
  2013-01-22 17:28 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Yi Zhang @ 2013-01-22  3:24 UTC (permalink / raw)
  To: alan; +Cc: yizhang.mrvl, linux-serial, Yi Zhang

1) serial_pxa_console_write() can be used in atomic context,
   so change clk_prepare_clk to clk_enable
2) add clk_prepare() to follow common clock driver

Signed-off-by: Yi Zhang <yizhang@marvell.com>
---
 drivers/tty/serial/pxa.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c
index 2764828..d5cbcf6 100644
--- a/drivers/tty/serial/pxa.c
+++ b/drivers/tty/serial/pxa.c
@@ -673,7 +673,7 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count)
 	unsigned long flags;
 	int locked = 1;
 
-	clk_prepare_enable(up->clk);
+	clk_enable(up->clk);
 
 	local_irq_save(flags);
 	if (up->port.sysrq)
@@ -702,7 +702,7 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count)
 		spin_unlock(&up->port.lock);
 	local_irq_restore(flags);
 
-	clk_disable_unprepare(up->clk);
+	clk_disable(up->clk);
 }
 
 #ifdef CONFIG_CONSOLE_POLL
@@ -899,6 +899,12 @@ static int serial_pxa_probe(struct platform_device *dev)
 		goto err_free;
 	}
 
+	ret = clk_prepare(sport->clk);
+	if (ret) {
+		clk_put(sport->clk);
+		goto err_free;
+	}
+
 	sport->port.type = PORT_PXA;
 	sport->port.iotype = UPIO_MEM;
 	sport->port.mapbase = mmres->start;
@@ -930,6 +936,7 @@ static int serial_pxa_probe(struct platform_device *dev)
 	return 0;
 
  err_clk:
+	clk_unprepare(sport->clk);
 	clk_put(sport->clk);
  err_free:
 	kfree(sport);
@@ -943,6 +950,8 @@ static int serial_pxa_remove(struct platform_device *dev)
 	platform_set_drvdata(dev, NULL);
 
 	uart_remove_one_port(&serial_pxa_reg, &sport->port);
+
+	clk_unprepare(sport->clk);
 	clk_put(sport->clk);
 	kfree(sport);
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] serial: pxa: fix clk_prepare/unprepare misuse
  2013-01-22  3:24 [PATCH] serial: pxa: fix clk_prepare/unprepare misuse Yi Zhang
@ 2013-01-22 17:28 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2013-01-22 17:28 UTC (permalink / raw)
  To: Yi Zhang; +Cc: alan, yizhang.mrvl, linux-serial

On Tue, Jan 22, 2013 at 11:24:50AM +0800, Yi Zhang wrote:
> 1) serial_pxa_console_write() can be used in atomic context,
>    so change clk_prepare_clk to clk_enable
> 2) add clk_prepare() to follow common clock driver
> 
> Signed-off-by: Yi Zhang <yizhang@marvell.com>
> ---
>  drivers/tty/serial/pxa.c |   13 +++++++++++--
>  1 files changed, 11 insertions(+), 2 deletions(-)

This patch fails to apply to my tree:
patching file drivers/tty/serial/pxa.c
Hunk #1 FAILED at 673.
Hunk #2 FAILED at 702.
Hunk #3 succeeded at 896 (offset -3 lines).
Hunk #4 succeeded at 933 (offset -3 lines).
Hunk #5 succeeded at 947 (offset -3 lines).
2 out of 5 hunks FAILED -- saving rejects to file drivers/tty/serial/pxa.c.rej

Please redo it against the tty-next git tree and resend.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-22 17:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-22  3:24 [PATCH] serial: pxa: fix clk_prepare/unprepare misuse Yi Zhang
2013-01-22 17:28 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.