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

Alexandre Courbot acourbot at nvidia.com
Fri Sep 30 10:37:00 CEST 2016


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 at 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..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;
 	}
-- 
2.10.0



More information about the U-Boot mailing list