+static int check_thermal_zone_and_trip_id(struct device *dev,
+ struct thermal_zone_device *tz,
+ int trip_id)
+{
+ if (!device_is_registered(dev))
+ return -ENODEV;
+
+ if (trip_id < 0 || trip_id >= tz->num_trips)
+ return -EINVAL;
I'm not sure if this check is useful. The function is called from
trip_point_*_store() which is providing the trip id from the file name
parsing which is in turn built from an existing trip id. There is no
reason the trip id is going to be wrong.
I can drop the check just fine.
Do you have any other comments on this patch?