Skip to content

Commit a7f3b67

Browse files
larsclausenbebarino
authored andcommitted
clk: si514: 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: Lars-Peter Clausen <lars@metafoo.de> Link: https://lore.kernel.org/r/20230410014502.27929-8-lars@metafoo.de Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 56fc9a3 commit a7f3b67

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

drivers/clk/clk-si514.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,8 @@ static int si514_probe(struct i2c_client *client)
360360
dev_err(&client->dev, "clock registration failed\n");
361361
return err;
362362
}
363-
err = of_clk_add_hw_provider(client->dev.of_node, of_clk_hw_simple_get,
364-
&data->hw);
363+
err = devm_of_clk_add_hw_provider(&client->dev, of_clk_hw_simple_get,
364+
&data->hw);
365365
if (err) {
366366
dev_err(&client->dev, "unable to add clk provider\n");
367367
return err;
@@ -370,11 +370,6 @@ static int si514_probe(struct i2c_client *client)
370370
return 0;
371371
}
372372

373-
static void si514_remove(struct i2c_client *client)
374-
{
375-
of_clk_del_provider(client->dev.of_node);
376-
}
377-
378373
static const struct i2c_device_id si514_id[] = {
379374
{ "si514", 0 },
380375
{ }
@@ -393,7 +388,6 @@ static struct i2c_driver si514_driver = {
393388
.of_match_table = clk_si514_of_match,
394389
},
395390
.probe_new = si514_probe,
396-
.remove = si514_remove,
397391
.id_table = si514_id,
398392
};
399393
module_i2c_driver(si514_driver);

0 commit comments

Comments
 (0)