mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 19:07:52 +00:00
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>
This commit is contained in:
parent
09d4922d3c
commit
f6c90df8e7
1 changed files with 3 additions and 2 deletions
|
@ -76,16 +76,17 @@ int sprd_clk_probe(struct device *dev, struct clk_hw_onecell_data *clkhw)
|
||||||
struct clk_hw *hw;
|
struct clk_hw *hw;
|
||||||
|
|
||||||
for (i = 0; i < clkhw->num; i++) {
|
for (i = 0; i < clkhw->num; i++) {
|
||||||
|
const char *name;
|
||||||
|
|
||||||
hw = clkhw->hws[i];
|
hw = clkhw->hws[i];
|
||||||
|
|
||||||
if (!hw)
|
if (!hw)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
name = hw->init->name;
|
||||||
ret = devm_clk_hw_register(dev, hw);
|
ret = devm_clk_hw_register(dev, hw);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(dev, "Couldn't register clock %d - %s\n",
|
dev_err(dev, "Couldn't register clock %d - %s\n",
|
||||||
i, hw->init->name);
|
i, name);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue