mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-27 15:10:26 +09:00
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>
This commit is contained in:
parent
5f82a940a0
commit
0f9b2b3ddf
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user