diff options
author | Chunfeng Yun <chunfeng.yun@mediatek.com> | 2020-01-09 06:35:05 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-01-16 17:39:45 +0300 |
commit | 0f9b2b3ddf36d4bf69011a0dddefa10091cee60d (patch) | |
tree | b97889be0f3388ccbd2b84f53ac2ca7b23604884 /drivers | |
parent | 5f82a940a0379e32b3553bc0cd6d3ece2f8d0141 (diff) | |
download | u-boot-0f9b2b3ddf36d4bf69011a0dddefa10091cee60d.tar.xz |
clk: fix error check for devm_clk_get_optional()
If skip all return error number, it may skip some real error cases,
so only skip the error when the clock is not provided in DTS
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/clk/clk-uclass.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index 9aa8537004..2778b504c0 100644 --- a/drivers/clk/clk-uclass.c +++ b/drivers/clk/clk-uclass.c @@ -678,7 +678,7 @@ struct clk *devm_clk_get_optional(struct udevice *dev, const char *id) { struct clk *clk = devm_clk_get(dev, id); - if (IS_ERR(clk)) + if (PTR_ERR(clk) == -ENODATA) return NULL; return clk; |