diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-07-02 16:41:03 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-07-09 18:22:59 +0200 |
commit | d1fbf18a0f9403df2edeffa1c7f5a2d66e82c20a (patch) | |
tree | c2f5eba88c11128df42f56c62070b4bccbcdac46 /include/linux/thermal.h | |
parent | 463b86fed2b25ddb5f576376bfea00134dd23030 (diff) | |
download | lwn-d1fbf18a0f9403df2edeffa1c7f5a2d66e82c20a.tar.gz lwn-d1fbf18a0f9403df2edeffa1c7f5a2d66e82c20a.zip |
thermal: trip: Add conversion macros for thermal trip priv field
Some drivers will need to store integers in the priv field of struct
thermal_trip, so add conversion macros for doing this in a consistent
way and switch over the int340x_thermal driver that already does it and
uses custom conversion functions to using the new macros.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/3297884.aeNJFYEL58@rjwysocki.net
Diffstat (limited to 'include/linux/thermal.h')
-rw-r--r-- | include/linux/thermal.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 5a0b66bd34f0..3bd1b361ec34 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -79,6 +79,9 @@ struct thermal_trip { #define THERMAL_TRIP_FLAG_RW (THERMAL_TRIP_FLAG_RW_TEMP | \ THERMAL_TRIP_FLAG_RW_HYST) +#define THERMAL_TRIP_PRIV_TO_INT(_val_) (uintptr_t)(_val_) +#define THERMAL_INT_TO_TRIP_PRIV(_val_) (void *)(uintptr_t)(_val_) + struct thermal_zone_device; struct thermal_zone_device_ops { |