lkml.org 
[lkml]   [2022]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 01/30] thermal/core: Add a generic thermal_zone_get_trip() function
From
Date
> @@ -1142,6 +1138,52 @@ static void thermal_set_delay_jiffies(unsigned
> long *delay_jiffies, int delay_ms
> *delay_jiffies = round_jiffies(*delay_jiffies);
> }
>
> +int thermal_zone_get_num_trips(struct thermal_zone_device *tz)
> +{
> + return tz->num_trips;
> +}
> +EXPORT_SYMBOL_GPL(thermal_zone_get_num_trips);
> +
> +static int __thermal_zone_get_trip(struct thermal_zone_device *tz,
> int trip_id,
> + struct thermal_trip *trip)
> +{
> + int ret;
> +
> + if (!tz || trip_id < 0 || trip_id >= tz->num_trips || !trip)
> + return -EINVAL;
> +
> + if (tz->trips) {
> + *trip = tz->trips[trip_id];
> + return 0;
> + }
> +
> + if (tz->ops->get_trip_hyst) {
> + ret = tz->ops->get_trip_hyst(tz, trip_id, &trip-
> >hysteresis);
> + if (ret)
> + return ret;
> + } else trip->hysteresis = 0;

a separate line?

Other than that,
Reviewed-by: Zhang Rui <rui.zhang@intel.com>

thanks,
rui

\
 
 \ /
  Last update: 2022-09-23 15:55    [W:0.316 / U:0.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site