thermal: Constify the trip argument of the .get_trend() zone callback

Add 'const' to the definition of the 'trip' argument of the
.get_trend() thermal zone callback to indicate that the trip point
passed to it should not be modified by it and adjust the
callback functions implementing it, thermal_get_trend() in the
ACPI thermal driver and __ti_thermal_get_trend(), accordingly.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Michal Wilczynski <michal.wilczynski@intel.com>
This commit is contained in:
Rafael J. Wysocki 2023-09-07 20:18:56 +02:00
parent 8a81cf96f5
commit ebc7abb35b
3 changed files with 5 additions and 4 deletions

View file

@ -492,7 +492,7 @@ static int thermal_get_temp(struct thermal_zone_device *thermal, int *temp)
} }
static int thermal_get_trend(struct thermal_zone_device *thermal, static int thermal_get_trend(struct thermal_zone_device *thermal,
struct thermal_trip *trip, const struct thermal_trip *trip,
enum thermal_trend *trend) enum thermal_trend *trend)
{ {
struct acpi_thermal *tz = thermal_zone_device_priv(thermal); struct acpi_thermal *tz = thermal_zone_device_priv(thermal);

View file

@ -110,7 +110,8 @@ static inline int __ti_thermal_get_temp(struct thermal_zone_device *tz, int *tem
} }
static int __ti_thermal_get_trend(struct thermal_zone_device *tz, static int __ti_thermal_get_trend(struct thermal_zone_device *tz,
struct thermal_trip *trip, enum thermal_trend *trend) const struct thermal_trip *trip,
enum thermal_trend *trend)
{ {
struct ti_thermal_data *data = thermal_zone_device_priv(tz); struct ti_thermal_data *data = thermal_zone_device_priv(tz);
struct ti_bandgap *bgp; struct ti_bandgap *bgp;

View file

@ -80,8 +80,8 @@ struct thermal_zone_device_ops {
int (*set_trip_hyst) (struct thermal_zone_device *, int, int); int (*set_trip_hyst) (struct thermal_zone_device *, int, int);
int (*get_crit_temp) (struct thermal_zone_device *, int *); int (*get_crit_temp) (struct thermal_zone_device *, int *);
int (*set_emul_temp) (struct thermal_zone_device *, int); int (*set_emul_temp) (struct thermal_zone_device *, int);
int (*get_trend) (struct thermal_zone_device *, struct thermal_trip *, int (*get_trend) (struct thermal_zone_device *,
enum thermal_trend *); const struct thermal_trip *, enum thermal_trend *);
void (*hot)(struct thermal_zone_device *); void (*hot)(struct thermal_zone_device *);
void (*critical)(struct thermal_zone_device *); void (*critical)(struct thermal_zone_device *);
}; };