Skip to contentSkip to conversation

Input: elan_i2c - switch to using devm_add_action_or_reset()

PATCH New Dmitry Torokhov 1 participant 1 message Jul 13, 2019

Subsystems (2)
lore
Share & tools
lore

Dmitry Torokhov

author maintainer
#0 lore raw

PATCH 1/1 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.

---
 drivers/input/mouse/elan_i2c_core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/input/mouse/elan_i2c_core.c +1 -2
index b549d032da93..8719da540383 100644
@@ -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;
Signature · 5 lines
2.22.0.510.g264f2c817a-goog


-- 
Dmitry