summaryrefslogtreecommitdiff
path: root/drivers/regulator/fp9931.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator/fp9931.c')
-rw-r--r--drivers/regulator/fp9931.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/regulator/fp9931.c b/drivers/regulator/fp9931.c
index 7fbcc6327cc6..abea3b69d8a0 100644
--- a/drivers/regulator/fp9931.c
+++ b/drivers/regulator/fp9931.c
@@ -144,13 +144,12 @@ static int fp9931_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
return ret;
ret = regmap_read(data->regmap, FP9931_REG_TMST_VALUE, &val);
- if (ret)
- return ret;
+ if (!ret)
+ *temp = (s8)val * 1000;
pm_runtime_put_autosuspend(data->dev);
- *temp = (s8)val * 1000;
- return 0;
+ return ret;
}
static umode_t fp9931_hwmon_is_visible(const void *data,