mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-04 13:21:45 +00:00
clk: si5351: implement remove handler
The driver has no remove function, so it does not cleanup resources that are not under devm management. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
This commit is contained in:
parent
4fbd8d194f
commit
758231d5a8
1 changed files with 13 additions and 0 deletions
|
@ -1619,6 +1619,18 @@ err_clk:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int si5351_i2c_remove(struct i2c_client *client)
|
||||||
|
{
|
||||||
|
struct si5351_driver_data *drvdata = i2c_get_clientdata(client);
|
||||||
|
|
||||||
|
of_clk_del_provider(client->dev.of_node);
|
||||||
|
if (!IS_ERR(drvdata->pxtal))
|
||||||
|
clk_disable_unprepare(drvdata->pxtal);
|
||||||
|
if (!IS_ERR(drvdata->pclkin))
|
||||||
|
clk_disable_unprepare(drvdata->pclkin);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static const struct i2c_device_id si5351_i2c_ids[] = {
|
static const struct i2c_device_id si5351_i2c_ids[] = {
|
||||||
{ "si5351a", SI5351_VARIANT_A },
|
{ "si5351a", SI5351_VARIANT_A },
|
||||||
{ "si5351a-msop", SI5351_VARIANT_A3 },
|
{ "si5351a-msop", SI5351_VARIANT_A3 },
|
||||||
|
@ -1634,6 +1646,7 @@ static struct i2c_driver si5351_driver = {
|
||||||
.of_match_table = of_match_ptr(si5351_dt_ids),
|
.of_match_table = of_match_ptr(si5351_dt_ids),
|
||||||
},
|
},
|
||||||
.probe = si5351_i2c_probe,
|
.probe = 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);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue