Skip to content

Commit f5e50bf

Browse files
andrzejtpdlezcano
authored andcommitted
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 <[email protected]> [for acerhdf] Acked-by: Peter Kaestle <[email protected]> Reviewed-by: Bartlomiej Zolnierkiewicz <[email protected]> Reviewed-by: Amit Kucheria <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 5d7bd8a commit f5e50bf

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

drivers/platform/x86/acerhdf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,8 @@ static inline void acerhdf_enable_kernelmode(void)
413413
* the temperature and the fan.
414414
* disabled: the BIOS takes control of the fan.
415415
*/
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)
418418
{
419419
if (mode == THERMAL_DEVICE_DISABLED && kernelmode)
420420
acerhdf_revert_to_bios_mode();
@@ -473,7 +473,7 @@ static struct thermal_zone_device_ops acerhdf_dev_ops = {
473473
.bind = acerhdf_bind,
474474
.unbind = acerhdf_unbind,
475475
.get_temp = acerhdf_get_ec_temp,
476-
.set_mode = acerhdf_set_mode,
476+
.change_mode = acerhdf_change_mode,
477477
.get_trip_type = acerhdf_get_trip_type,
478478
.get_trip_hyst = acerhdf_get_trip_hyst,
479479
.get_trip_temp = acerhdf_get_trip_temp,

drivers/thermal/imx_thermal.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,8 @@ static int imx_get_temp(struct thermal_zone_device *tz, int *temp)
330330
return 0;
331331
}
332332

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)
335335
{
336336
struct imx_thermal_data *data = tz->devdata;
337337
struct regmap *map = data->tempmon;
@@ -447,7 +447,7 @@ static struct thermal_zone_device_ops imx_tz_ops = {
447447
.bind = imx_bind,
448448
.unbind = imx_unbind,
449449
.get_temp = imx_get_temp,
450-
.set_mode = imx_set_mode,
450+
.change_mode = imx_change_mode,
451451
.get_trip_type = imx_get_trip_type,
452452
.get_trip_temp = imx_get_trip_temp,
453453
.get_crit_temp = imx_get_crit_temp,
@@ -860,7 +860,7 @@ static int __maybe_unused imx_thermal_suspend(struct device *dev)
860860
* Need to disable thermal sensor, otherwise, when thermal core
861861
* try to get temperature before thermal sensor resume, a wrong
862862
* 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
864864
* thermal_zone_device_disable()
865865
*/
866866
ret = thermal_zone_device_disable(data->tz);

drivers/thermal/intel/int340x_thermal/int3400_thermal.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,8 @@ static int int3400_thermal_get_temp(struct thermal_zone_device *thermal,
377377
return 0;
378378
}
379379

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)
382382
{
383383
struct int3400_thermal_priv *priv = thermal->devdata;
384384
int result = 0;
@@ -399,7 +399,7 @@ static int int3400_thermal_set_mode(struct thermal_zone_device *thermal,
399399

400400
static struct thermal_zone_device_ops int3400_thermal_ops = {
401401
.get_temp = int3400_thermal_get_temp,
402-
.set_mode = int3400_thermal_set_mode,
402+
.change_mode = int3400_thermal_change_mode,
403403
};
404404

405405
static struct thermal_zone_params int3400_thermal_params = {

drivers/thermal/intel/intel_quark_dts_thermal.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ static int sys_get_curr_temp(struct thermal_zone_device *tzd,
298298
return 0;
299299
}
300300

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)
303303
{
304304
int ret;
305305

@@ -319,7 +319,7 @@ static struct thermal_zone_device_ops tzone_ops = {
319319
.get_trip_type = sys_get_trip_type,
320320
.set_trip_temp = sys_set_trip_temp,
321321
.get_crit_temp = sys_get_crit_temp,
322-
.set_mode = sys_set_mode,
322+
.change_mode = sys_change_mode,
323323
};
324324

325325
static void free_soc_dts(struct soc_sensor_entry *aux_entry)

drivers/thermal/thermal_core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,8 @@ static int thermal_zone_device_set_mode(struct thermal_zone_device *tz,
482482
return ret;
483483
}
484484

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);
487487

488488
if (!ret)
489489
tz->mode = mode;

include/linux/thermal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ struct thermal_zone_device_ops {
7676
struct thermal_cooling_device *);
7777
int (*get_temp) (struct thermal_zone_device *, int *);
7878
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 *,
8080
enum thermal_device_mode);
8181
int (*get_trip_type) (struct thermal_zone_device *, int,
8282
enum thermal_trip_type *);

0 commit comments

Comments
 (0)