summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTero Kristo <[email protected]>2021-06-11 11:45:08 +0300
committerLokesh Vutla <[email protected]>2021-06-11 16:34:52 +0530
commit920ea5a7f8cd05810ede2fc5c0a51d75ae00d175 (patch)
tree951774dcb8e1ba683a236b5007a34073644b6f5c
parent1a725e229096385b4fb8d59247584435779d0161 (diff)
clk: do not attempt to fetch clock pointer with null device
Bail out early if device returned for the parent clock is null. This avoids warning prints like this when doing clk dump: dev_get_uclass_priv: null device Signed-off-by: Tero Kristo <[email protected]> Signed-off-by: Tero Kristo <[email protected]>
-rw-r--r--drivers/clk/clk-uclass.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c
index 53e7be764d3..451d7da001a 100644
--- a/drivers/clk/clk-uclass.c
+++ b/drivers/clk/clk-uclass.c
@@ -502,6 +502,8 @@ struct clk *clk_get_parent(struct clk *clk)
return NULL;
pdev = dev_get_parent(clk->dev);
+ if (!pdev)
+ return ERR_PTR(-ENODEV);
pclk = dev_get_clk_ptr(pdev);
if (!pclk)
return ERR_PTR(-ENODEV);