summaryrefslogtreecommitdiff
path: root/drivers/clk/socfpga/clk-periph-a10.c
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@kernel.org>2019-07-31 12:35:14 -0700
committerStephen Boyd <sboyd@kernel.org>2019-08-16 10:20:07 -0700
commit09d4922d3c94832962c572808bac20dbee5004c5 (patch)
tree270122babdd8a0d86d67d1a6b1cfc5ec9a47d699 /drivers/clk/socfpga/clk-periph-a10.c
parentaf55dadfbce35b4f4c6247244ce3e44b2e242b84 (diff)
clk: socfpga: Don't reference clk_init_data after registration
A future patch is going to change semantics of clk_register() so that clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid referencing this member here so that we don't run into NULL pointer exceptions. Cc: Dinh Nguyen <dinguyen@kernel.org> Signed-off-by: Stephen Boyd <sboyd@kernel.org> Link: https://lkml.kernel.org/r/20190731193517.237136-7-sboyd@kernel.org Acked-by: Dinh Nguyen <dinguyen@kernel.org>
Diffstat (limited to 'drivers/clk/socfpga/clk-periph-a10.c')
-rw-r--r--drivers/clk/socfpga/clk-periph-a10.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/clk/socfpga/clk-periph-a10.c b/drivers/clk/socfpga/clk-periph-a10.c
index a8ff7229611d..3e0c55727b89 100644
--- a/drivers/clk/socfpga/clk-periph-a10.c
+++ b/drivers/clk/socfpga/clk-periph-a10.c
@@ -40,11 +40,12 @@ static u8 clk_periclk_get_parent(struct clk_hw *hwclk)
{
struct socfpga_periph_clk *socfpgaclk = to_socfpga_periph_clk(hwclk);
u32 clk_src;
+ const char *name = clk_hw_get_name(hwclk);
clk_src = readl(socfpgaclk->hw.reg);
- if (streq(hwclk->init->name, SOCFPGA_MPU_FREE_CLK) ||
- streq(hwclk->init->name, SOCFPGA_NOC_FREE_CLK) ||
- streq(hwclk->init->name, SOCFPGA_SDMMC_FREE_CLK))
+ if (streq(name, SOCFPGA_MPU_FREE_CLK) ||
+ streq(name, SOCFPGA_NOC_FREE_CLK) ||
+ streq(name, SOCFPGA_SDMMC_FREE_CLK))
return (clk_src >> CLK_MGR_FREE_SHIFT) &
CLK_MGR_FREE_MASK;
else