Skip to contentSkip to conversation

clk: si5341: Fix clock HW provider cleanup

PATCH Applied Robert Hancock 2 participants 2 messages Jan 12, 2022 – Jan 13, 2022 Common clk

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 3044a860fd09 ("clk: Add Si5341/Si5340 driver")
---
 drivers/clk/clk-si5341.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/clk-si5341.c +1 -1
index 57ae183982d8..f7b41366666e 100644
@@ -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");
Signature · 1 line
2.31.1
maintainer Applied
#1 lore raw

Quoting Robert Hancock (2022-01-12 12:38:16)

Quoted 8 lines

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 3044a860fd09 ("clk: Add Si5341/Si5340 driver")

---

Applied to clk-next