Re: [PATCH v13 3/8] clk: Use devm_ in the register fixed factor clock
From: Ilia Lin <ilia.lin@kernel.org>
Date: 2018-10-14 06:49:34
Thanks! I'll do the change ASAP. On Sat, Oct 13, 2018 at 1:08 AM Stephen Boyd [off-list ref] wrote:
Quoting Ricardo Salveti (2018-09-14 11:53:02)quoted
On Thu, Jun 14, 2018 at 6:55 PM [off-list ref] wrote:quoted
From: Ilia Lin <redacted> Use devm_clk_hw_register instead of clk_hw_register to simplify the usage of this API. This way drivers that call the clk_hw_register_fixed_factor won't need to maintain a data structure for further cleanup. Signed-off-by: Ilia Lin <redacted> Tested-by: Amit Kucheria <redacted> --- drivers/clk/clk-fixed-factor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)diff --git a/drivers/clk/clk-fixed-factor.cb/drivers/clk/clk-fixed-factor.cquoted
quoted
index a5d402de5584..8e39bda8e596 100644--- a/drivers/clk/clk-fixed-factor.c +++ b/drivers/clk/clk-fixed-factor.c@@ -94,7 +94,7 @@ struct clk_hw *clk_hw_register_fixed_factor(structdevice *dev,quoted
quoted
init.num_parents = 1; hw = &fix->hw; - ret = clk_hw_register(dev, hw); + ret = devm_clk_hw_register(dev, hw);Not sure what is the current state of this patch-set, but this change breaks drivers calling clk_hw_register_fixed_factor with a NULL dev (e.g. imx_clk_fixed_factor), as devm_clk_hw_register needs a valid dev for devres_add to work.Yep. Probably better to just have a driver register the clk_hw structure itself with the clk framework vs. trying to get it right here in the generic type registration function.