Skip to content

Commit aaa6d06

Browse files
shawnguo2bebarino
authored andcommitted
ASoC: kirkwood: fix struct clk pointer comparing
Since commit 035a61c ("clk: Make clk API return per-user struct clk instances"), clk API users can no longer check if two struct clk pointers are pointing to the same hardware clock, i.e. struct clk_hw, by simply comparing two pointers. That's because with the per-user clk change, a brand new struct clk is created whenever clients try to look up the clock by calling clk_get() or sister functions like clk_get_sys() and of_clk_get(). This changes the original behavior where the struct clk is only created for once when clock driver registers the clock to CCF in the first place. The net change here is before commit 035a61c the struct clk pointer is unique for given hardware clock, while after the commit the pointers returned by clk lookup calls become different for the same hardware clock. That said, the struct clk pointer comparing in the code doesn't work any more. Call helper function clk_is_match() instead to fix the problem. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Michael Turquette <mturquette@linaro.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
1 parent 81efec8 commit aaa6d06

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/soc/kirkwood/kirkwood-i2s.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
579579
if (PTR_ERR(priv->extclk) == -EPROBE_DEFER)
580580
return -EPROBE_DEFER;
581581
} else {
582-
if (priv->extclk == priv->clk) {
582+
if (clk_is_match(priv->extclk, priv->clk)) {
583583
devm_clk_put(&pdev->dev, priv->extclk);
584584
priv->extclk = ERR_PTR(-EINVAL);
585585
} else {

0 commit comments

Comments
 (0)