Skip to content

Commit a85739c

Browse files
committed
thermal: Get rid of CONFIG_THERMAL_WRITABLE_TRIPS
The only difference made by CONFIG_THERMAL_WRITABLE_TRIPS is whether or not the writable trips mask passed during thermal zone registration will take any effect, but whoever passes a non-zero writable trips mask to thermal_zone_device_register_with_trips() can be forgiven thinking that it will always work. Moreover, some thermal drivers expect user space to set trip temperature values, so they select CONFIG_THERMAL_WRITABLE_TRIPS, possibly overriding a manual choice to unset it and going against the design purportedly allowing system integrators to decide on the writability of trip points for the given kernel build. It is also set in one platform's defconfig. Forthermore, CONFIG_THERMAL_WRITABLE_TRIPS only affects trip temperature, because trip hysteresis is writable as long as the thermal zone provides a callback to update it, regardless of the CONFIG_THERMAL_WRITABLE_TRIPS value. The above means that the symbol in question is used inconsistently and its purpose is at least moot, so remove it and always take the writable trip mask passed to thermal_zone_device_register_with_trips() into account. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
1 parent 62dd178 commit a85739c

File tree

4 files changed

+1
-16
lines changed

4 files changed

+1
-16
lines changed

arch/arm/configs/imx_v6_v7_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ CONFIG_SENSORS_IIO_HWMON=y
228228
CONFIG_SENSORS_PWM_FAN=y
229229
CONFIG_SENSORS_SY7636A=y
230230
CONFIG_THERMAL_STATISTICS=y
231-
CONFIG_THERMAL_WRITABLE_TRIPS=y
232231
CONFIG_CPU_THERMAL=y
233232
CONFIG_IMX_THERMAL=y
234233
CONFIG_WATCHDOG=y

drivers/thermal/Kconfig

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,6 @@ config THERMAL_OF
8383
Say 'Y' here if you need to build thermal infrastructure
8484
based on device tree.
8585

86-
config THERMAL_WRITABLE_TRIPS
87-
bool "Enable writable trip points"
88-
help
89-
This option allows the system integrator to choose whether
90-
trip temperatures can be changed from userspace. The
91-
writable trips need to be specified when setting up the
92-
thermal zone but the choice here takes precedence.
93-
94-
Say 'Y' here if you would like to allow userspace tools to
95-
change trip temperatures.
96-
9786
choice
9887
prompt "Default Thermal governor"
9988
default THERMAL_DEFAULT_GOV_STEP_WISE

drivers/thermal/intel/Kconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ config X86_PKG_TEMP_THERMAL
2323
tristate "X86 package temperature thermal driver"
2424
depends on X86_THERMAL_VECTOR
2525
select THERMAL_GOV_USER_SPACE
26-
select THERMAL_WRITABLE_TRIPS
2726
select INTEL_TCC
2827
default m
2928
help
@@ -47,7 +46,6 @@ config INTEL_SOC_DTS_THERMAL
4746
tristate "Intel SoCs DTS thermal driver"
4847
depends on X86 && PCI && ACPI
4948
select INTEL_SOC_DTS_IOSF_CORE
50-
select THERMAL_WRITABLE_TRIPS
5149
help
5250
Enable this to register Intel SoCs (e.g. Bay Trail) platform digital
5351
temperature sensor (DTS). These SoCs have two additional DTSs in

drivers/thermal/thermal_sysfs.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,7 @@ static int create_trip_attrs(struct thermal_zone_device *tz, int mask)
458458
tz->trip_temp_attrs[indx].name;
459459
tz->trip_temp_attrs[indx].attr.attr.mode = S_IRUGO;
460460
tz->trip_temp_attrs[indx].attr.show = trip_point_temp_show;
461-
if (IS_ENABLED(CONFIG_THERMAL_WRITABLE_TRIPS) &&
462-
mask & (1 << indx)) {
461+
if (mask & (1 << indx)) {
463462
tz->trip_temp_attrs[indx].attr.attr.mode |= S_IWUSR;
464463
tz->trip_temp_attrs[indx].attr.store =
465464
trip_point_temp_store;

0 commit comments

Comments
 (0)