===================================================================
@@ -291,24 +291,6 @@ static irqreturn_t qpnp_tm_isr(int irq,
return IRQ_HANDLED;
}
-static int qpnp_tm_get_critical_trip_temp(struct qpnp_tm_chip *chip)
-{
- struct thermal_trip trip;
- int i, ret;
-
- for (i = 0; i < thermal_zone_get_num_trips(chip->tz_dev); i++) {
-
- ret = thermal_zone_get_trip(chip->tz_dev, i, &trip);
- if (ret)
- continue;
-
- if (trip.type == THERMAL_TRIP_CRITICAL)
- return trip.temperature;
- }
-
- return THERMAL_TEMP_INVALID;
-}
-
/*
* This function initializes the internal temp value based on only the
* current thermal stage and threshold. Setup threshold control and
@@ -343,7 +325,9 @@ static int qpnp_tm_init(struct qpnp_tm_c
mutex_unlock(&chip->lock);
- crit_temp = qpnp_tm_get_critical_trip_temp(chip);
+ ret = thermal_zone_get_crit_temp(chip->tz_dev, &crit_temp);
+ if (ret)
+ crit_temp = THERMAL_TEMP_INVALID;
mutex_lock(&chip->lock);