Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: hi6220: use CLK_OF_DECLARE_DRIVER for sysctrl and mediactrl clock init

The hi6220-sysctrl and hi6220-mediactrl are not only clock provider but
also reset controller. It worked fine that single sysctrl/mediactrl
device node in DT can be used to initialize clock driver and populate
platform device for reset controller. But it stops working after
commit 989eafd0b609 ("clk: core: Avoid double initialization of clocks")
gets merged. The commit sets flag OF_POPULATED during clock
initialization to skip the platform device populating for the same
device node. On hi6220, it effectively makes hi6220-sysctrl reset
driver not probe any more.

The patch changes hi6220 sysctrl and mediactrl clock init macro from
CLK_OF_DECLARE to CLK_OF_DECLARE_DRIVER, so that the reset driver using
the same hardware block can continue working.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Tested-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

authored by

Shawn Guo and committed by
Stephen Boyd
d3397484 4aa6c99d

+2 -2
+2 -2
drivers/clk/hisilicon/clk-hi6220.c
··· 195 195 hi6220_clk_register_divider(hi6220_div_clks_sys, 196 196 ARRAY_SIZE(hi6220_div_clks_sys), clk_data); 197 197 } 198 - CLK_OF_DECLARE(hi6220_clk_sys, "hisilicon,hi6220-sysctrl", hi6220_clk_sys_init); 198 + CLK_OF_DECLARE_DRIVER(hi6220_clk_sys, "hisilicon,hi6220-sysctrl", hi6220_clk_sys_init); 199 199 200 200 201 201 /* clocks in media controller */ ··· 252 252 hi6220_clk_register_divider(hi6220_div_clks_media, 253 253 ARRAY_SIZE(hi6220_div_clks_media), clk_data); 254 254 } 255 - CLK_OF_DECLARE(hi6220_clk_media, "hisilicon,hi6220-mediactrl", hi6220_clk_media_init); 255 + CLK_OF_DECLARE_DRIVER(hi6220_clk_media, "hisilicon,hi6220-mediactrl", hi6220_clk_media_init); 256 256 257 257 258 258 /* clocks in pmctrl */