Commit 2e75cfaa authored by Dmitry Torokhov's avatar Dmitry Torokhov

Input: elan_i2c - switch to using devm_add_action_or_reset()

Instead of manually disabling regulators when devm_add_action() fails we can
use devm_add_action_or_reset() which does it for us.
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 9609b904
......@@ -1187,9 +1187,8 @@ static int elan_probe(struct i2c_client *client,
return error;
}
error = devm_add_action(dev, elan_disable_regulator, data);
error = devm_add_action_or_reset(dev, elan_disable_regulator, data);
if (error) {
regulator_disable(data->vcc);
dev_err(dev, "Failed to add disable regulator action: %d\n",
error);
return error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment