Skip to content

Commit

Permalink
thermal/hwmon: Do not set no_hwmon before calling thermal_add_hwmon_s…
Browse files Browse the repository at this point in the history
…ysfs()

The thermal->tzp->no_hwmon parameter is only used when calling
thermal_zone_device_register().

Setting it to 'false' before calling thermal_add_hwmon_sysfs() has no
effect.

Remove the call and again prevent the drivers to access the thermal
internals.

Reviewed-by: Niklas Söderlund <[email protected]> #R-Car
Signed-off-by: Daniel Lezcano <[email protected]>
Acked-by: Florian Fainelli <[email protected]> #Broadcom
Acked-by: Heiko Stuebner <[email protected]> #rockchip
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
dlezcano authored and rafaeljw committed Mar 3, 2023
1 parent abda738 commit 8f3f4ad
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 10 deletions.
1 change: 0 additions & 1 deletion drivers/thermal/broadcom/bcm2711_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ static int bcm2711_thermal_probe(struct platform_device *pdev)

priv->thermal = thermal;

thermal->tzp->no_hwmon = false;
return thermal_add_hwmon_sysfs(thermal);
}

Expand Down
1 change: 0 additions & 1 deletion drivers/thermal/broadcom/bcm2835_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
* Thermal_zone doesn't enable hwmon as default,
* enable it here
*/
tz->tzp->no_hwmon = false;
err = thermal_add_hwmon_sysfs(tz);
if (err)
goto err_tz;
Expand Down
1 change: 0 additions & 1 deletion drivers/thermal/rcar_gen3_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,6 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
}
tsc->zone = zone;

tsc->zone->tzp->no_hwmon = false;
ret = thermal_add_hwmon_sysfs(tsc->zone);
if (ret)
goto error_unregister;
Expand Down
5 changes: 0 additions & 5 deletions drivers/thermal/rcar_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,11 +509,6 @@ static int rcar_thermal_probe(struct platform_device *pdev)
}

if (chip->use_of_thermal) {
/*
* thermal_zone doesn't enable hwmon as default,
* but, enable it here to keep compatible
*/
priv->zone->tzp->no_hwmon = false;
ret = thermal_add_hwmon_sysfs(priv->zone);
if (ret)
goto error_unregister;
Expand Down
1 change: 0 additions & 1 deletion drivers/thermal/rockchip_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1451,7 +1451,6 @@ static int rockchip_thermal_probe(struct platform_device *pdev)

for (i = 0; i < thermal->chip->chn_num; i++) {
rockchip_thermal_toggle_sensor(&thermal->sensors[i], true);
thermal->sensors[i].tzd->tzp->no_hwmon = false;
error = thermal_add_hwmon_sysfs(thermal->sensors[i].tzd);
if (error)
dev_warn(&pdev->dev,
Expand Down
1 change: 0 additions & 1 deletion drivers/thermal/rzg2l_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ static int rzg2l_thermal_probe(struct platform_device *pdev)
}

priv->zone = zone;
priv->zone->tzp->no_hwmon = false;
ret = thermal_add_hwmon_sysfs(priv->zone);
if (ret)
goto err;
Expand Down

0 comments on commit 8f3f4ad

Please sign in to comment.