diff options
Diffstat (limited to 'drivers/thermal/thermal-generic-adc.c')
-rw-r--r-- | drivers/thermal/thermal-generic-adc.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/thermal/thermal-generic-adc.c b/drivers/thermal/thermal-generic-adc.c index 323e273e3298..017b0ce52122 100644 --- a/drivers/thermal/thermal-generic-adc.c +++ b/drivers/thermal/thermal-generic-adc.c @@ -54,15 +54,14 @@ static int gadc_thermal_adc_to_temp(struct gadc_thermal_info *gti, int val) static int gadc_thermal_get_temp(struct thermal_zone_device *tz, int *temp) { - struct gadc_thermal_info *gti = tz->devdata; + struct gadc_thermal_info *gti = thermal_zone_device_priv(tz); int val; int ret; ret = iio_read_channel_processed(gti->channel, &val); - if (ret < 0) { - dev_err(gti->dev, "IIO channel read failed %d\n", ret); + if (ret < 0) return ret; - } + *temp = gadc_thermal_adc_to_temp(gti, val); return 0; |