public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] serial: ns16550: Fix serial output on Tegra186
Date: Fri, 30 Sep 2016 10:46:09 +0200	[thread overview]
Message-ID: <20160930084609.13307-1-thierry.reding@gmail.com> (raw)

From: Thierry Reding <treding@nvidia.com>

For Tegra186 there are currently no UART clocks wired up in device tree.
This exposes a regression introduced in commit 50fce1d5d874 ("serial:
ns16550: Support clocks via phandle"), which causes the p2771-0000-500
board (and probably any Tegra186-based board as well) to fail to boot.

The reason is that if no clocks property exists, then clk_get_by_index()
returns -ENOENT (via fdtdec_parse_phandle_with_args()) rather than
-ENODEV as the above-mentioned commit expects.

Fix this by checking for the right error code.

Reported-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/serial/ns16550.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 765499dab646..9c36dbe2a566 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -408,7 +408,7 @@ int ns16550_serial_ofdata_to_platdata(struct udevice *dev)
 		err = clk_get_rate(&clk);
 		if (!IS_ERR_VALUE(err))
 			plat->clock = err;
-	} else if (err != -ENODEV && err != -ENOSYS) {
+	} else if (err != -ENOENT && err != -ENOSYS) {
 		debug("ns16550 failed to get clock\n");
 		return err;
 	}
-- 
2.10.0

             reply	other threads:[~2016-09-30  8:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-30  8:46 Thierry Reding [this message]
2016-09-30  8:53 ` [U-Boot] [PATCH] serial: ns16550: Fix serial output on Tegra186 Alexandre Courbot
2016-09-30  9:47   ` Paul Burton
2016-09-30  9:57     ` Alexandre Courbot
2016-09-30 10:32     ` Thierry Reding
2016-10-03 15:51 ` Stephen Warren
2016-10-03 16:14   ` Stephen Warren

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=20160930084609.13307-1-thierry.reding@gmail.com \
    --to=thierry.reding@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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