]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
serial: ns16550: Handle -ENOENT when requesting clock
authorAlexandre Courbot <acourbot@nvidia.com>
Fri, 30 Sep 2016 08:37:00 +0000 (17:37 +0900)
committerTom Rini <trini@konsulko.com>
Thu, 6 Oct 2016 14:31:59 +0000 (10:31 -0400)
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>
drivers/serial/ns16550.c

index 765499dab64648fc1c5082f6ddc6526635aa7700..29d547166b9053a9c2e4a77b1ce43019140eb936 100644 (file)
@@ -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;
        }