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

thermal: Rename set_mode() to change_mode()

set_mode() is only called when tzd's mode is about to change. Actual
setting is performed in thermal_core, in thermal_zone_device_set_mode().
The meaning of set_mode() callback is actually to notify the driver about
the mode being changed and giving the driver a chance to oppose such
change.

To better reflect the purpose of the method rename it to change_mode()

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
[for acerhdf]
Acked-by: Peter Kaestle <peter@piie.net>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20200629122925.21729-12-andrzej.p@collabora.com

authored by

Andrzej Pietrasiewicz and committed by
Daniel Lezcano
f5e50bf4 5d7bd8aa

+16 -16
+3 -3
drivers/platform/x86/acerhdf.c
··· 413 413 * the temperature and the fan. 414 414 * disabled: the BIOS takes control of the fan. 415 415 */ 416 - static int acerhdf_set_mode(struct thermal_zone_device *thermal, 417 - enum thermal_device_mode mode) 416 + static int acerhdf_change_mode(struct thermal_zone_device *thermal, 417 + enum thermal_device_mode mode) 418 418 { 419 419 if (mode == THERMAL_DEVICE_DISABLED && kernelmode) 420 420 acerhdf_revert_to_bios_mode(); ··· 473 473 .bind = acerhdf_bind, 474 474 .unbind = acerhdf_unbind, 475 475 .get_temp = acerhdf_get_ec_temp, 476 - .set_mode = acerhdf_set_mode, 476 + .change_mode = acerhdf_change_mode, 477 477 .get_trip_type = acerhdf_get_trip_type, 478 478 .get_trip_hyst = acerhdf_get_trip_hyst, 479 479 .get_trip_temp = acerhdf_get_trip_temp,
+4 -4
drivers/thermal/imx_thermal.c
··· 330 330 return 0; 331 331 } 332 332 333 - static int imx_set_mode(struct thermal_zone_device *tz, 334 - enum thermal_device_mode mode) 333 + static int imx_change_mode(struct thermal_zone_device *tz, 334 + enum thermal_device_mode mode) 335 335 { 336 336 struct imx_thermal_data *data = tz->devdata; 337 337 struct regmap *map = data->tempmon; ··· 447 447 .bind = imx_bind, 448 448 .unbind = imx_unbind, 449 449 .get_temp = imx_get_temp, 450 - .set_mode = imx_set_mode, 450 + .change_mode = imx_change_mode, 451 451 .get_trip_type = imx_get_trip_type, 452 452 .get_trip_temp = imx_get_trip_temp, 453 453 .get_crit_temp = imx_get_crit_temp, ··· 860 860 * Need to disable thermal sensor, otherwise, when thermal core 861 861 * try to get temperature before thermal sensor resume, a wrong 862 862 * temperature will be read as the thermal sensor is powered 863 - * down. This is done in set_mode() operation called from 863 + * down. This is done in change_mode() operation called from 864 864 * thermal_zone_device_disable() 865 865 */ 866 866 ret = thermal_zone_device_disable(data->tz);
+3 -3
drivers/thermal/intel/int340x_thermal/int3400_thermal.c
··· 377 377 return 0; 378 378 } 379 379 380 - static int int3400_thermal_set_mode(struct thermal_zone_device *thermal, 381 - enum thermal_device_mode mode) 380 + static int int3400_thermal_change_mode(struct thermal_zone_device *thermal, 381 + enum thermal_device_mode mode) 382 382 { 383 383 struct int3400_thermal_priv *priv = thermal->devdata; 384 384 int result = 0; ··· 399 399 400 400 static struct thermal_zone_device_ops int3400_thermal_ops = { 401 401 .get_temp = int3400_thermal_get_temp, 402 - .set_mode = int3400_thermal_set_mode, 402 + .change_mode = int3400_thermal_change_mode, 403 403 }; 404 404 405 405 static struct thermal_zone_params int3400_thermal_params = {
+3 -3
drivers/thermal/intel/intel_quark_dts_thermal.c
··· 298 298 return 0; 299 299 } 300 300 301 - static int sys_set_mode(struct thermal_zone_device *tzd, 302 - enum thermal_device_mode mode) 301 + static int sys_change_mode(struct thermal_zone_device *tzd, 302 + enum thermal_device_mode mode) 303 303 { 304 304 int ret; 305 305 ··· 319 319 .get_trip_type = sys_get_trip_type, 320 320 .set_trip_temp = sys_set_trip_temp, 321 321 .get_crit_temp = sys_get_crit_temp, 322 - .set_mode = sys_set_mode, 322 + .change_mode = sys_change_mode, 323 323 }; 324 324 325 325 static void free_soc_dts(struct soc_sensor_entry *aux_entry)
+2 -2
drivers/thermal/thermal_core.c
··· 482 482 return ret; 483 483 } 484 484 485 - if (tz->ops->set_mode) 486 - ret = tz->ops->set_mode(tz, mode); 485 + if (tz->ops->change_mode) 486 + ret = tz->ops->change_mode(tz, mode); 487 487 488 488 if (!ret) 489 489 tz->mode = mode;
+1 -1
include/linux/thermal.h
··· 76 76 struct thermal_cooling_device *); 77 77 int (*get_temp) (struct thermal_zone_device *, int *); 78 78 int (*set_trips) (struct thermal_zone_device *, int, int); 79 - int (*set_mode) (struct thermal_zone_device *, 79 + int (*change_mode) (struct thermal_zone_device *, 80 80 enum thermal_device_mode); 81 81 int (*get_trip_type) (struct thermal_zone_device *, int, 82 82 enum thermal_trip_type *);