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

thermal/hwmon: Do not set no_hwmon before calling thermal_add_hwmon_sysfs()

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 <niklas.soderlund+renesas@ragnatech.se> #R-Car
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Florian Fainelli <f.fainelli@gmail.com> #Broadcom
Acked-by: Heiko Stuebner <heiko@sntech.de> #rockchip
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Daniel Lezcano and committed by
Rafael J. Wysocki
8f3f4ad4 abda7383

-10
-1
drivers/thermal/broadcom/bcm2711_thermal.c
··· 98 98 99 99 priv->thermal = thermal; 100 100 101 - thermal->tzp->no_hwmon = false; 102 101 return thermal_add_hwmon_sysfs(thermal); 103 102 } 104 103
-1
drivers/thermal/broadcom/bcm2835_thermal.c
··· 267 267 * Thermal_zone doesn't enable hwmon as default, 268 268 * enable it here 269 269 */ 270 - tz->tzp->no_hwmon = false; 271 270 err = thermal_add_hwmon_sysfs(tz); 272 271 if (err) 273 272 goto err_tz;
-1
drivers/thermal/rcar_gen3_thermal.c
··· 527 527 } 528 528 tsc->zone = zone; 529 529 530 - tsc->zone->tzp->no_hwmon = false; 531 530 ret = thermal_add_hwmon_sysfs(tsc->zone); 532 531 if (ret) 533 532 goto error_unregister;
-5
drivers/thermal/rcar_thermal.c
··· 509 509 } 510 510 511 511 if (chip->use_of_thermal) { 512 - /* 513 - * thermal_zone doesn't enable hwmon as default, 514 - * but, enable it here to keep compatible 515 - */ 516 - priv->zone->tzp->no_hwmon = false; 517 512 ret = thermal_add_hwmon_sysfs(priv->zone); 518 513 if (ret) 519 514 goto error_unregister;
-1
drivers/thermal/rockchip_thermal.c
··· 1451 1451 1452 1452 for (i = 0; i < thermal->chip->chn_num; i++) { 1453 1453 rockchip_thermal_toggle_sensor(&thermal->sensors[i], true); 1454 - thermal->sensors[i].tzd->tzp->no_hwmon = false; 1455 1454 error = thermal_add_hwmon_sysfs(thermal->sensors[i].tzd); 1456 1455 if (error) 1457 1456 dev_warn(&pdev->dev,
-1
drivers/thermal/rzg2l_thermal.c
··· 216 216 } 217 217 218 218 priv->zone = zone; 219 - priv->zone->tzp->no_hwmon = false; 220 219 ret = thermal_add_hwmon_sysfs(priv->zone); 221 220 if (ret) 222 221 goto err;