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:
Chunfeng Yun 2020-01-09 11:35:05 +08:00 committed by Tom Rini
parent 5f82a940a0
commit 0f9b2b3ddf

View file

@ -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;