summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/chipcap2.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hwmon/chipcap2.c b/drivers/hwmon/chipcap2.c
index a62c507b1042..3b604fc5d8ae 100644
--- a/drivers/hwmon/chipcap2.c
+++ b/drivers/hwmon/chipcap2.c
@@ -324,7 +324,9 @@ static int cc2_get_reg_val(struct cc2_data *data, u8 reg, long *val)
int ret;
ret = cc2_read_reg(data, reg, &reg_val);
- *val = cc2_rh_convert(reg_val);
+ if (!ret)
+ *val = cc2_rh_convert(reg_val);
+
cc2_disable(data);
return ret;