summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/tmp102.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-08-01 22:49:13 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2016-08-01 22:49:13 +0200
commit2790aed095fe50b21ab7ed94dc34a0f410a3872c (patch)
tree842f28c60c19d52029b71d9b623393b2057b7c34 /drivers/hwmon/tmp102.c
parentMerge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert... (diff)
parenthwmon: (adt7411) set sane values for CFG1 and CFG3 (diff)
downloadlinux-2790aed095fe50b21ab7ed94dc34a0f410a3872c.tar.xz
linux-2790aed095fe50b21ab7ed94dc34a0f410a3872c.zip
Merge tag 'hwmon-for-linus-v4.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull more hwmon updates from Guenter Roeck: - Improved error handling in tmp102, lm75, and lm90 drivers - Bug fixes in sht3x, ftsteutates, iio_hwmon, and adt7411 drivers * tag 'hwmon-for-linus-v4.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (adt7411) set sane values for CFG1 and CFG3 hwmon: (iio_hwmon) fix memory leak in name attribute hwmon: (ftsteutates) Fix potential memory access error hwmon: (tmp102) Improve error handling hwmon: (lm75) Improve error handling hwmon: (lm90) Improve error handling hwmon: (lm90) Add missing assignment hwmon: (sht3x) set initial jiffies to last_update
Diffstat (limited to 'drivers/hwmon/tmp102.c')
-rw-r--r--drivers/hwmon/tmp102.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hwmon/tmp102.c b/drivers/hwmon/tmp102.c
index a942a2574a4d..8479ac5eb853 100644
--- a/drivers/hwmon/tmp102.c
+++ b/drivers/hwmon/tmp102.c
@@ -227,7 +227,9 @@ static int tmp102_probe(struct i2c_client *client,
tmp102->config_orig = regval;
- devm_add_action(dev, tmp102_restore_config, tmp102);
+ err = devm_add_action_or_reset(dev, tmp102_restore_config, tmp102);
+ if (err)
+ return err;
regval &= ~TMP102_CONFIG_CLEAR;
regval |= TMP102_CONFIG_SET;