mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-25 16:11:45 +00:00
thermal: convert mtk_thermal to use devm_thermal_zone_of_sensor_register
This changes the driver to use the devm_ version of thermal_zone_of_sensor_register and cleans up the local points and unregister calls. Cc: Zhang Rui <rui.zhang@intel.com> Cc: Matthias Brugger <matthias.bgg@gmail.com> Cc: linux-pm@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
This commit is contained in:
parent
44a520d81e
commit
c417bdedb1
1 changed files with 2 additions and 10 deletions
|
@ -144,7 +144,6 @@ struct mtk_thermal {
|
||||||
s32 o_slope;
|
s32 o_slope;
|
||||||
s32 vts[MT8173_NUM_SENSORS];
|
s32 vts[MT8173_NUM_SENSORS];
|
||||||
|
|
||||||
struct thermal_zone_device *tzd;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct mtk_thermal_bank_cfg {
|
struct mtk_thermal_bank_cfg {
|
||||||
|
@ -572,16 +571,11 @@ static int mtk_thermal_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
platform_set_drvdata(pdev, mt);
|
platform_set_drvdata(pdev, mt);
|
||||||
|
|
||||||
mt->tzd = thermal_zone_of_sensor_register(&pdev->dev, 0, mt,
|
devm_thermal_zone_of_sensor_register(&pdev->dev, 0, mt,
|
||||||
&mtk_thermal_ops);
|
&mtk_thermal_ops);
|
||||||
if (IS_ERR(mt->tzd))
|
|
||||||
goto err_register;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_register:
|
|
||||||
clk_disable_unprepare(mt->clk_peri_therm);
|
|
||||||
|
|
||||||
err_disable_clk_auxadc:
|
err_disable_clk_auxadc:
|
||||||
clk_disable_unprepare(mt->clk_auxadc);
|
clk_disable_unprepare(mt->clk_auxadc);
|
||||||
|
|
||||||
|
@ -592,8 +586,6 @@ static int mtk_thermal_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct mtk_thermal *mt = platform_get_drvdata(pdev);
|
struct mtk_thermal *mt = platform_get_drvdata(pdev);
|
||||||
|
|
||||||
thermal_zone_of_sensor_unregister(&pdev->dev, mt->tzd);
|
|
||||||
|
|
||||||
clk_disable_unprepare(mt->clk_peri_therm);
|
clk_disable_unprepare(mt->clk_peri_therm);
|
||||||
clk_disable_unprepare(mt->clk_auxadc);
|
clk_disable_unprepare(mt->clk_auxadc);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue