Thread (62 messages) 62 messages, 6 authors, 2017-03-14
STALE3418d

[PATCH 29/33] Input: melfas_mip4 - Use devm_add_action_or_reset and other changes

From: Guenter Roeck <linux@roeck-us.net>
Date: 2017-01-18 17:49:08
Also in: lkml
Subsystem: input (keyboard, mouse, joystick, touchscreen) drivers, the rest · Maintainers: Dmitry Torokhov, Linus Torvalds

Replace devm_add_action() followed by failure action with
devm_add_action_or_reset()

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Replace devm_add_action() followed by failure action with
  devm_add_action_or_reset()
- Replace 'goto l; ... l: return e;' with 'return e;'

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/touchscreen/melfas_mip4.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/input/touchscreen/melfas_mip4.c b/drivers/input/touchscreen/melfas_mip4.c
index 703d7f983d0a..3cad6f72dbf8 100644
--- a/drivers/input/touchscreen/melfas_mip4.c
+++ b/drivers/input/touchscreen/melfas_mip4.c
@@ -594,7 +594,7 @@ static irqreturn_t mip4_interrupt(int irq, void *dev_id)
 	if (error) {
 		dev_err(&client->dev,
 			"Failed to read packet info: %d\n", error);
-		goto out;
+		return IRQ_HANDLED;
 	}
 
 	size = ts->buf[0] & 0x7F;
@@ -604,7 +604,7 @@ static irqreturn_t mip4_interrupt(int irq, void *dev_id)
 	/* Check size */
 	if (!size) {
 		dev_err(&client->dev, "Empty packet\n");
-		goto out;
+		return IRQ_HANDLED;
 	}
 
 	/* Read packet data */
@@ -614,7 +614,7 @@ static irqreturn_t mip4_interrupt(int irq, void *dev_id)
 	if (error) {
 		dev_err(&client->dev,
 			"Failed to read packet data: %d\n", error);
-		goto out;
+		return IRQ_HANDLED;
 	}
 
 	if (alert) {
@@ -629,7 +629,6 @@ static irqreturn_t mip4_interrupt(int irq, void *dev_id)
 		input_sync(ts->input);
 	}
 
-out:
 	return IRQ_HANDLED;
 }
 
@@ -1531,9 +1530,8 @@ static int mip4_probe(struct i2c_client *client, const struct i2c_device_id *id)
 		return error;
 	}
 
-	error = devm_add_action(&client->dev, mip4_sysfs_remove, ts);
+	error = devm_add_action_or_reset(&client->dev, mip4_sysfs_remove, ts);
 	if (error) {
-		mip4_sysfs_remove(ts);
 		dev_err(&client->dev,
 			"Failed to install sysfs remoce action: %d\n", error);
 		return error;
-- 
2.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help