summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSam Ravnborg <srn@skov.dk>2017-07-03 21:21:02 +0200
committerLucas Stach <l.stach@pengutronix.de>2017-07-07 14:37:38 +0200
commit90b0100ad82343fd7cd2bd08e5147959d2da2e2c (patch)
tree50f686b3941e95954509e63cc97b3ca33c2cdbf1 /drivers
parent56edc2e99a7782fbc5a1b3011030392d06832b72 (diff)
downloadbarebox-90b0100ad82343fd7cd2bd08e5147959d2da2e2c.tar.gz
barebox-90b0100ad82343fd7cd2bd08e5147959d2da2e2c.tar.xz
clk: fix clk_get error handling
If there is no OFTREE support of_clk_get_by_name failed with -ENOENT, which caused clk_get to bail out. This had the effect that nothing was printed on the serial console with at91sam9263-ek. There are no error paths that will return -ENODEV as we test for today, so change this to -ENOENT which is in use. This allows us to contine with clk_get_sys() in case of other errors as was the intention of the original fix. Fixes: 90f7eacb ("clk: let clk_get return errors from of_clk_get_by_name") Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/clk/clkdev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
index 6b16663551..abdc415272 100644
--- a/drivers/clk/clkdev.c
+++ b/drivers/clk/clkdev.c
@@ -181,7 +181,7 @@ struct clk *clk_get(struct device_d *dev, const char *con_id)
if (dev) {
clk = of_clk_get_by_name(dev->device_node, con_id);
- if (!IS_ERR(clk) || PTR_ERR(clk) != -ENODEV)
+ if (!IS_ERR(clk) || PTR_ERR(clk) != -ENOENT)
return clk;
}