Thread (29 messages) 29 messages, 2 authors, 2020-05-05

Re: [PATCH V6 12/12] clk: imx: scu: unregister clocks if add provider failed

From: Stephen Boyd <sboyd@kernel.org>
Date: 2020-05-05 04:55:56
Also in: linux-clk

Quoting Dong Aisheng (2020-03-15 06:43:56)
Unregister clocks if add provider failed

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>

---
Why isn't this squashed in to where it's needed?
quoted hunk ↗ jump to hunk
ChangeLog:
v6: new patch
---
 drivers/clk/imx/clk-imx8qxp.c | 11 +++++++++--
 drivers/clk/imx/clk-scu.c     | 13 +++++++++++++
 drivers/clk/imx/clk-scu.h     |  2 ++
 3 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/imx/clk-imx8qxp.c b/drivers/clk/imx/clk-imx8qxp.c
index 2ec3e0c4749d..e615214495c0 100644
--- a/drivers/clk/imx/clk-imx8qxp.c
+++ b/drivers/clk/imx/clk-imx8qxp.c
@@ -138,10 +138,17 @@ static int imx8qxp_clk_probe(struct platform_device *pdev)
                                i, PTR_ERR(clks[i]));
        }
 
-       if (clk_cells == 2)
+       if (clk_cells == 2) {
                ret = of_clk_add_hw_provider(ccm_node, imx_scu_of_clk_src_get, imx_scu_clks);
-       else
+               if (ret)
+                       imx_clk_scu_unregister();
+       } else {
+               /*
+                * NOTE: we did not unregister clocks for the legacy way cause
+                * it will be removed later.
I got confused what 'it' was. I think it's the legacy way entirely.
Maybe say "legacy binding code path doesn't unregister here because..."
+                */
                ret = of_clk_add_hw_provider(ccm_node, of_clk_hw_onecell_get, clk_data);
+       }
 
        return ret;
 }
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help