提交 0f9b2b3d 编写于 作者: C Chunfeng Yun 提交者: Tom Rini

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: NChunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: NSimon Glass <sjg@chromium.org>
Reviewed-by: NRyder Lee <ryder.lee@mediatek.com>
上级 5f82a940
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册