Commit 49a8f2bc authored by Robert Hancock's avatar Robert Hancock Committed by Stephen Boyd

clk: si5341: Fix clock HW provider cleanup

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: 3044a860 ("clk: Add Si5341/Si5340 driver")
Signed-off-by: default avatarRobert Hancock <robert.hancock@calian.com>
Link: https://lore.kernel.org/r/20220112203816.1784610-1-robert.hancock@calian.comSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 4afd2a93
...@@ -1740,7 +1740,7 @@ static int si5341_probe(struct i2c_client *client, ...@@ -1740,7 +1740,7 @@ static int si5341_probe(struct i2c_client *client,
clk_prepare(data->clk[i].hw.clk); 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); data);
if (err) { if (err) {
dev_err(&client->dev, "unable to add clk provider\n"); dev_err(&client->dev, "unable to add clk provider\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment