Skip to content

Commit f6c90df

Browse files
committed
clk: sprd: 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: Chunyan Zhang <zhang.chunyan@linaro.org> Cc: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Stephen Boyd <sboyd@kernel.org> Link: https://lkml.kernel.org/r/20190731193517.237136-8-sboyd@kernel.org Acked-by: Baolin Wang <baolin.wang@linaro.org> Acked-by: Chunyan Zhang <zhang.chunyan@linaro.org>
1 parent 09d4922 commit f6c90df

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎drivers/clk/sprd/common.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,17 @@ int sprd_clk_probe(struct device *dev, struct clk_hw_onecell_data *clkhw)
7676
struct clk_hw *hw;
7777

7878
for (i = 0; i < clkhw->num; i++) {
79+
const char *name;
7980

8081
hw = clkhw->hws[i];
81-
8282
if (!hw)
8383
continue;
8484

85+
name = hw->init->name;
8586
ret = devm_clk_hw_register(dev, hw);
8687
if (ret) {
8788
dev_err(dev, "Couldn't register clock %d - %s\n",
88-
i, hw->init->name);
89+
i, name);
8990
return ret;
9091
}
9192
}

0 commit comments

Comments
 (0)