When an clk is defined with only one parent it probably has no
set_parent function. Therefor changing the parent would return with
-EINVAL. We check for this case and skip this function in this case.

Signed-off-by: Michael Grzeschik <[email protected]>
---
 drivers/clk/clk.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 89a007a12c5..ac5b83cf8b4 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -302,6 +302,9 @@ int clk_set_parent(struct clk *clk, struct clk *newparent)
        if (IS_ERR(newparent))
                return PTR_ERR(newparent);
 
+       if (newparent == curparent)
+               return 0;
+
        if (!clk->num_parents)
                return -EINVAL;
        if (!clk->ops->set_parent)
-- 
2.47.3


Reply via email to