projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
90e2b54
)
hwmon: (tmp102) Improve error handling
author
Guenter Roeck
<linux@roeck-us.net>
Mon, 25 Jul 2016 21:57:47 +0000
(14:57 -0700)
committer
Guenter Roeck
<linux@roeck-us.net>
Sun, 31 Jul 2016 22:02:51 +0000
(15:02 -0700)
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>
drivers/hwmon/tmp102.c
patch
|
blob
|
history
diff --git
a/drivers/hwmon/tmp102.c
b/drivers/hwmon/tmp102.c
index
a942a25
..
8479ac5
100644
(file)
--- 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;