Skip to content

Commit 2e75cfa

Browse files
committed
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: Dmitry Torokhov <[email protected]>
1 parent 9609b90 commit 2e75cfa

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/input/mouse/elan_i2c_core.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,9 +1187,8 @@ static int elan_probe(struct i2c_client *client,
11871187
return error;
11881188
}
11891189

1190-
error = devm_add_action(dev, elan_disable_regulator, data);
1190+
error = devm_add_action_or_reset(dev, elan_disable_regulator, data);
11911191
if (error) {
1192-
regulator_disable(data->vcc);
11931192
dev_err(dev, "Failed to add disable regulator action: %d\n",
11941193
error);
11951194
return error;

0 commit comments

Comments
 (0)