Skip to content

Commit 49a8f2b

Browse files
robhancocksedbebarino
authored andcommitted
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: 3044a86 ("clk: Add Si5341/Si5340 driver") Signed-off-by: Robert Hancock <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 4afd2a9 commit 49a8f2b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/clk/clk-si5341.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1740,7 +1740,7 @@ static int si5341_probe(struct i2c_client *client,
17401740
clk_prepare(data->clk[i].hw.clk);
17411741
}
17421742

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

0 commit comments

Comments
 (0)