diff mbox

[U-Boot] serial: ns16550: Handle -ENOENT when requesting clock

Message ID 20160930083700.28915-1-acourbot@nvidia.com
State Accepted
Commit ab895d6af224a427db4ffb70884588a2449be1c6
Delegated to: Tom Rini
Headers show

Commit Message

Alexandre Courbot Sept. 30, 2016, 8:37 a.m. UTC
When calling clk_get_by_index(), fall back to the legacy method of
getting the clock if -ENOENT is returned.

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

Comments

Alexandre Courbot Sept. 30, 2016, 8:54 a.m. UTC | #1
On 09/30/2016 05:37 PM, Alexandre Courbot wrote:
> When calling clk_get_by_index(), fall back to the legacy method of
> getting the clock if -ENOENT is returned.

Withdrawing this patch as Thierry sent a better version of it.
Stephen Warren Oct. 3, 2016, 4:23 p.m. UTC | #2
On 09/30/2016 02:37 AM, Alexandre Courbot wrote:
> When calling clk_get_by_index(), fall back to the legacy method of
> getting the clock if -ENOENT is returned.

Tested-by: Stephen Warren <swarren@nvidia.com>
Thierry Reding Oct. 4, 2016, 12:37 p.m. UTC | #3
On Mon, Oct 03, 2016 at 10:23:49AM -0600, Stephen Warren wrote:
> On 09/30/2016 02:37 AM, Alexandre Courbot wrote:
> > When calling clk_get_by_index(), fall back to the legacy method of
> > getting the clock if -ENOENT is returned.
> 
> Tested-by: Stephen Warren <swarren@nvidia.com>

Agreed, this looks like the more correct fix in retrospect.

Acked-by: Thierry Reding <treding@nvidia.com>
Tom Rini Oct. 7, 2016, 12:32 a.m. UTC | #4
On Fri, Sep 30, 2016 at 05:37:00PM +0900, Alexandre Courbot wrote:

> When calling clk_get_by_index(), fall back to the legacy method of
> getting the clock if -ENOENT is returned.
> 
> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
> Tested-by: Stephen Warren <swarren@nvidia.com>
> Acked-by: Thierry Reding <treding@nvidia.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 765499dab646..29d547166b90 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 != -ENODEV && err != -ENOSYS) {
 		debug("ns16550 failed to get clock\n");
 		return err;
 	}