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

clk: lochnagar: 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: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lkml.kernel.org/r/20190731193517.237136-3-sboyd@kernel.org
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>

+1 -1
+1 -1
drivers/clk/clk-lochnagar.c
··· 198 198 if (ret < 0) { 199 199 dev_dbg(priv->dev, "Failed to read parent of %s: %d\n", 200 200 lclk->name, ret); 201 - return hw->init->num_parents; 201 + return clk_hw_get_num_parents(hw); 202 202 } 203 203 204 204 val &= lclk->src_mask;