aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hwmon/adt7410.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/hwmon/adt7410.c b/drivers/hwmon/adt7410.c
index f8606dff3d1c..030c8d7c33a5 100644
--- a/drivers/hwmon/adt7410.c
+++ b/drivers/hwmon/adt7410.c
@@ -236,9 +236,14 @@ static ssize_t adt7410_show_t_hyst(struct device *dev,
236 char *buf) 236 char *buf)
237{ 237{
238 struct sensor_device_attribute *attr = to_sensor_dev_attr(da); 238 struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
239 struct adt7410_data *data = adt7410_update_device(dev); 239 struct adt7410_data *data;
240 int nr = attr->index; 240 int nr = attr->index;
241 int hyst = (data->hyst & ADT7410_T_HYST_MASK) * 1000; 241 int hyst;
242
243 data = adt7410_update_device(dev);
244 if (IS_ERR(data))
245 return PTR_ERR(data);
246 hyst = (data->hyst & ADT7410_T_HYST_MASK) * 1000;
242 247
243 /* 248 /*
244 * hysteresis is stored as a 4 bit offset in the device, convert it 249 * hysteresis is stored as a 4 bit offset in the device, convert it