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>
This commit is contained in:
Родитель
56fc9a343a
Коммит
a7f3b6757a
|
@ -360,8 +360,8 @@ static int si514_probe(struct i2c_client *client)
|
||||||
dev_err(&client->dev, "clock registration failed\n");
|
dev_err(&client->dev, "clock registration failed\n");
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
err = of_clk_add_hw_provider(client->dev.of_node, of_clk_hw_simple_get,
|
err = devm_of_clk_add_hw_provider(&client->dev, of_clk_hw_simple_get,
|
||||||
&data->hw);
|
&data->hw);
|
||||||
if (err) {
|
if (err) {
|
||||||
dev_err(&client->dev, "unable to add clk provider\n");
|
dev_err(&client->dev, "unable to add clk provider\n");
|
||||||
return err;
|
return err;
|
||||||
|
@ -370,11 +370,6 @@ static int si514_probe(struct i2c_client *client)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void si514_remove(struct i2c_client *client)
|
|
||||||
{
|
|
||||||
of_clk_del_provider(client->dev.of_node);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct i2c_device_id si514_id[] = {
|
static const struct i2c_device_id si514_id[] = {
|
||||||
{ "si514", 0 },
|
{ "si514", 0 },
|
||||||
{ }
|
{ }
|
||||||
|
@ -393,7 +388,6 @@ static struct i2c_driver si514_driver = {
|
||||||
.of_match_table = clk_si514_of_match,
|
.of_match_table = clk_si514_of_match,
|
||||||
},
|
},
|
||||||
.probe_new = si514_probe,
|
.probe_new = si514_probe,
|
||||||
.remove = si514_remove,
|
|
||||||
.id_table = si514_id,
|
.id_table = si514_id,
|
||||||
};
|
};
|
||||||
module_i2c_driver(si514_driver);
|
module_i2c_driver(si514_driver);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче