Commit 361dde3c authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Stephen Boyd

clk: si5351: Use managed `of_clk_add_hw_provider()`

Use the managed `devm_of_clk_add_hw_provider()` instead of
`of_clk_add_hw_provider()`.

This makes sure the provider gets automatically removed on unbind and
allows to completely eliminate the drivers `remove()` callback.
Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20230410014502.27929-10-lars@metafoo.deSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent bda73391
...@@ -1641,8 +1641,8 @@ static int si5351_i2c_probe(struct i2c_client *client) ...@@ -1641,8 +1641,8 @@ static int si5351_i2c_probe(struct i2c_client *client)
} }
} }
ret = of_clk_add_hw_provider(client->dev.of_node, si53351_of_clk_get, ret = devm_of_clk_add_hw_provider(&client->dev, si53351_of_clk_get,
drvdata); drvdata);
if (ret) { if (ret) {
dev_err(&client->dev, "unable to add clk provider\n"); dev_err(&client->dev, "unable to add clk provider\n");
return ret; return ret;
...@@ -1651,18 +1651,12 @@ static int si5351_i2c_probe(struct i2c_client *client) ...@@ -1651,18 +1651,12 @@ static int si5351_i2c_probe(struct i2c_client *client)
return 0; return 0;
} }
static void si5351_i2c_remove(struct i2c_client *client)
{
of_clk_del_provider(client->dev.of_node);
}
static struct i2c_driver si5351_driver = { static struct i2c_driver si5351_driver = {
.driver = { .driver = {
.name = "si5351", .name = "si5351",
.of_match_table = of_match_ptr(si5351_dt_ids), .of_match_table = of_match_ptr(si5351_dt_ids),
}, },
.probe_new = si5351_i2c_probe, .probe_new = si5351_i2c_probe,
.remove = si5351_i2c_remove,
.id_table = si5351_i2c_ids, .id_table = si5351_i2c_ids,
}; };
module_i2c_driver(si5351_driver); module_i2c_driver(si5351_driver);
......
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