summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/tmp102.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2016-07-25 23:57:47 +0200
committerGuenter Roeck <linux@roeck-us.net>2016-08-01 00:02:51 +0200
commit1aa4f0289fd5554a9cd58e5b47a361b14256ea90 (patch)
tree16e50496c19c420d82aa83f612b34757f62f04f7 /drivers/hwmon/tmp102.c
parenthwmon: (lm75) Improve error handling (diff)
downloadlinux-1aa4f0289fd5554a9cd58e5b47a361b14256ea90.tar.xz
linux-1aa4f0289fd5554a9cd58e5b47a361b14256ea90.zip
hwmon: (tmp102) Improve error handling
Use devm_add_action_or_reset() instead of devm_add_action(), and check its return code. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to '')
-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;