Skip to content

Commit

Permalink
clk: si5341: Fix clock HW provider cleanup
Browse files Browse the repository at this point in the history
The call to of_clk_add_hw_provider was not undone on remove or on probe
failure, which could cause an oops on a subsequent attempt to retrieve
clocks for the removed device. Switch to the devm version of the
function to avoid this issue.

Fixes: 3044a86 ("clk: Add Si5341/Si5340 driver")
Signed-off-by: Robert Hancock <robert.hancock@calian.com>
Link: https://lore.kernel.org/r/20220112203816.1784610-1-robert.hancock@calian.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
  • Loading branch information
Robert Hancock authored and Stephen Boyd committed Jan 13, 2022
1 parent 4afd2a9 commit 49a8f2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/clk/clk-si5341.c
Original file line number Diff line number Diff line change
Expand Up @@ -1740,7 +1740,7 @@ static int si5341_probe(struct i2c_client *client,
clk_prepare(data->clk[i].hw.clk);
}

err = of_clk_add_hw_provider(client->dev.of_node, of_clk_si5341_get,
err = devm_of_clk_add_hw_provider(&client->dev, of_clk_si5341_get,
data);
if (err) {
dev_err(&client->dev, "unable to add clk provider\n");
Expand Down

0 comments on commit 49a8f2b

Please sign in to comment.