linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: shaju.abraham@linaro.org (shaju.abraham at linaro.org)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] Serial: Samsung: Fix uart clock init order
Date: Fri, 03 Sep 2010 10:45:34 +0530	[thread overview]
Message-ID: <1283490934-9728-1-git-send-email-shaju.abraham@linaro.org> (raw)

From: Shaju Abraham <shaju.abraham@linaro.org>

The clk_get API returns -ENOENT when invoked from s3c24xx_serial_initconsole.
This happens since the serial_console gets registered before the platform
driver is registered.Defer the call to clk_get to s3c24xx_serial_probe so that
the API returns a valid clock.

Signed-off-by: Shaju Abraham <shaju.abraham@linaro.org>
---
 drivers/serial/samsung.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/serial/samsung.c b/drivers/serial/samsung.c
index b1156ba..f6a526a 100644
--- a/drivers/serial/samsung.c
+++ b/drivers/serial/samsung.c
@@ -1115,7 +1115,6 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
 	if (ret > 0)
 		ourport->tx_irq = ret;
 
-	ourport->clk	= clk_get(&platdev->dev, "uart");
 
 	dbg("port: map=%08x, mem=%08x, irq=%d (%d,%d), clock=%ld\n",
 	    port->mapbase, port->membase, port->irq,
@@ -1159,6 +1158,8 @@ int s3c24xx_serial_probe(struct platform_device *dev,
 	if (ret < 0)
 		goto probe_err;
 
+	ourport->clk	= clk_get(&dev->dev, "uart");
+
 	dbg("%s: adding port\n", __func__);
 	uart_add_one_port(&s3c24xx_uart_drv, &ourport->port);
 	platform_set_drvdata(dev, &ourport->port);
-- 
1.6.2.5

                 reply	other threads:[~2010-09-03  5:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1283490934-9728-1-git-send-email-shaju.abraham@linaro.org \
    --to=shaju.abraham@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).