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()
Showing the changes to include/linux (1 of 6 files). Show all
Unified · Split
| @@ -76,7 +76,7 @@ struct thermal_zone_device_ops { · 75 unmodified lines | |||
| 76 | struct thermal_cooling_device *); | 76 | struct thermal_cooling_device *); |
| 77 | int (*get_temp) (struct thermal_zone_device *, int *); | 77 | int (*get_temp) (struct thermal_zone_device *, int *); |
| 78 | int (*set_trips) (struct thermal_zone_device *, int, int); | 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 | enum thermal_device_mode); | 80 | enum thermal_device_mode); |
| 81 | int (*get_trip_type) (struct thermal_zone_device *, int, | 81 | int (*get_trip_type) (struct thermal_zone_device *, int, |
| 82 | enum thermal_trip_type *); | 82 | enum thermal_trip_type *); |