Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alexey Khoroshilov and committed by
Stephen Boyd
758231d5 4fbd8d19

+13
+13
drivers/clk/clk-si5351.c
··· 1619 1619 return ret; 1620 1620 } 1621 1621 1622 + static int si5351_i2c_remove(struct i2c_client *client) 1623 + { 1624 + struct si5351_driver_data *drvdata = i2c_get_clientdata(client); 1625 + 1626 + of_clk_del_provider(client->dev.of_node); 1627 + if (!IS_ERR(drvdata->pxtal)) 1628 + clk_disable_unprepare(drvdata->pxtal); 1629 + if (!IS_ERR(drvdata->pclkin)) 1630 + clk_disable_unprepare(drvdata->pclkin); 1631 + return 0; 1632 + } 1633 + 1622 1634 static const struct i2c_device_id si5351_i2c_ids[] = { 1623 1635 { "si5351a", SI5351_VARIANT_A }, 1624 1636 { "si5351a-msop", SI5351_VARIANT_A3 }, ··· 1646 1634 .of_match_table = of_match_ptr(si5351_dt_ids), 1647 1635 }, 1648 1636 .probe = si5351_i2c_probe, 1637 + .remove = si5351_i2c_remove, 1649 1638 .id_table = si5351_i2c_ids, 1650 1639 }; 1651 1640 module_i2c_driver(si5351_driver);