diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2019-07-13 11:18:14 +0300 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2019-07-24 12:58:52 +0300 |
commit | 2e75cfaa32c113568994eda716a0bdddc92b376e (patch) | |
tree | 0db8e2e4177f08fa565fc83d8b8e3116193e4747 /drivers/input/mouse | |
parent | 9609b904c7eb411020d367d1f0904d0691819592 (diff) | |
download | linux-2e75cfaa32c113568994eda716a0bdddc92b376e.tar.xz |
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 <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r-- | drivers/input/mouse/elan_i2c_core.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c index b549d032da93..8719da540383 100644 --- a/drivers/input/mouse/elan_i2c_core.c +++ b/drivers/input/mouse/elan_i2c_core.c @@ -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; |