public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bram Vlerick <vlerickb@gmail.com>
To: dmitry.torokhov@gmail.com, michael.opdenacker@free-electrons.com
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] input: move gpio mouse to managed api
Date: Sat, 20 May 2017 15:13:25 +0200	[thread overview]
Message-ID: <20170520131325.21049-1-vlerickb@gmail.com> (raw)

Signed-off-by: Bram Vlerick <vlerickb@gmail.com>
---
 drivers/input/mouse/gpio_mouse.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/input/mouse/gpio_mouse.c b/drivers/input/mouse/gpio_mouse.c
index ced07391304b..2fc8ddaf0175 100644
--- a/drivers/input/mouse/gpio_mouse.c
+++ b/drivers/input/mouse/gpio_mouse.c
@@ -93,7 +93,7 @@ static int gpio_mouse_probe(struct platform_device *pdev)
 		}
 	}
 
-	input_poll = input_allocate_polled_device();
+	input_poll = devm_input_allocate_polled_device(&pdev->dev);
 	if (!input_poll) {
 		dev_err(&pdev->dev, "not enough memory for input device\n");
 		error = -ENOMEM;
@@ -124,7 +124,7 @@ static int gpio_mouse_probe(struct platform_device *pdev)
 	error = input_register_polled_device(input_poll);
 	if (error) {
 		dev_err(&pdev->dev, "could not register input device\n");
-		goto out_free_polldev;
+		goto out_free_gpios;
 	}
 
 	dev_dbg(&pdev->dev, "%d ms scan time, buttons: %s%s%s\n",
@@ -135,9 +135,6 @@ static int gpio_mouse_probe(struct platform_device *pdev)
 
 	return 0;
 
- out_free_polldev:
-	input_free_polled_device(input_poll);
-
  out_free_gpios:
 	while (--i >= 0) {
 		pin = pdata->pins[i];
@@ -155,7 +152,6 @@ static int gpio_mouse_remove(struct platform_device *pdev)
 	int pin, i;
 
 	input_unregister_polled_device(input);
-	input_free_polled_device(input);
 
 	for (i = 0; i < GPIO_MOUSE_PIN_MAX; i++) {
 		pin = pdata->pins[i];
-- 
2.12.2

             reply	other threads:[~2017-05-20 13:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-20 13:13 Bram Vlerick [this message]
2017-05-21  7:30 ` [PATCH] input: move gpio mouse to managed api Bram Vlerick
  -- strict thread matches above, loose matches on Subject: below --
2017-05-19 15:35 Bram Vlerick
2017-05-19 15:43 ` Michael Opdenacker
2017-05-19 20:28 ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170520131325.21049-1-vlerickb@gmail.com \
    --to=vlerickb@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.opdenacker@free-electrons.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox