linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pcf8574_keypad: use request_devm_threaded_irq
@ 2015-06-19 10:35 Michael Grzeschik
  2015-06-22 20:55 ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Grzeschik @ 2015-06-19 10:35 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input

We can use the devres API here. Remove the extra cleanup codepath.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
 drivers/input/misc/pcf8574_keypad.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/pcf8574_keypad.c b/drivers/input/misc/pcf8574_keypad.c
index 97f711a..62fcf36 100644
--- a/drivers/input/misc/pcf8574_keypad.c
+++ b/drivers/input/misc/pcf8574_keypad.c
@@ -131,7 +131,8 @@ static int pcf8574_kp_probe(struct i2c_client *client, const struct i2c_device_i
 
 	lp->laststate = read_state(lp);
 
-	ret = request_threaded_irq(client->irq, NULL, pcf8574_kp_irq_handler,
+	ret = devm_request_threaded_irq(&client->dev, client->irq,
+				   NULL, pcf8574_kp_irq_handler,
 				   IRQF_TRIGGER_LOW | IRQF_ONESHOT,
 				   DRV_NAME, lp);
 	if (ret) {
@@ -142,14 +143,12 @@ static int pcf8574_kp_probe(struct i2c_client *client, const struct i2c_device_i
 	ret = input_register_device(idev);
 	if (ret) {
 		dev_err(&client->dev, "input_register_device() failed\n");
-		goto fail_free_irq;
+		goto fail_free_device;
 	}
 
 	i2c_set_clientdata(client, lp);
 	return 0;
 
- fail_free_irq:
-	free_irq(client->irq, lp);
  fail_free_device:
 	input_free_device(idev);
  fail_allocate:
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-23  6:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-19 10:35 [PATCH] pcf8574_keypad: use request_devm_threaded_irq Michael Grzeschik
2015-06-22 20:55 ` Dmitry Torokhov
2015-06-23  6:42   ` Michael Grzeschik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).