提交 1aa4f028 编写于 作者: G Guenter Roeck

hwmon: (tmp102) Improve error handling

Use devm_add_action_or_reset() instead of devm_add_action(), and
check its return code.
Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
上级 90e2b545
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册