diff mbox series

[v2,2/7] clk: fix error check for devm_clk_get_optional()

Message ID 1578540910-3516-2-git-send-email-chunfeng.yun@mediatek.com
State Accepted
Commit 0f9b2b3ddf36d4bf69011a0dddefa10091cee60d
Headers show
Series [v2,1/7] clk: mediatek: mt7629: add support for ssusbsys | expand

Commit Message

Chunfeng Yun (云春峰) Jan. 9, 2020, 3:35 a.m. UTC
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 at mediatek.com>
Reviewed-by: Simon Glass <sjg at chromium.org>
Reviewed-by: Ryder Lee <ryder.lee at mediatek.com>
---
v2: add reviewed-by Simon & Ryder
---
 drivers/clk/clk-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini Jan. 16, 2020, 2:42 p.m. UTC | #1
On Thu, Jan 09, 2020 at 11:35:05AM +0800, Chunfeng Yun wrote:

> 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 at mediatek.com>
> Reviewed-by: Simon Glass <sjg at chromium.org>
> Reviewed-by: Ryder Lee <ryder.lee at mediatek.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

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;