===================================================================
@@ -75,7 +75,9 @@ static int int340x_thermal_get_trip_type
enum thermal_trip_type *type)
{
struct int34x_thermal_zone *d = zone->devdata;
- int i;
+ int i, ret = 0;
+
+ mutex_lock(&d->trip_mutex);
if (trip < d->aux_trip_nr)
*type = THERMAL_TRIP_PASSIVE;
@@ -94,10 +96,12 @@ static int int340x_thermal_get_trip_type
}
}
if (i == INT340X_THERMAL_MAX_ACT_TRIP_COUNT)
- return -EINVAL;
+ ret = -EINVAL;
}
- return 0;
+ mutex_unlock(&d->trip_mutex);
+
+ return ret;
}
static int int340x_thermal_set_trip_temp(struct thermal_zone_device *zone,