lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9c817d33-b430-a0fb-a439-d88c6b532a25@free-electrons.com>
Date:   Fri, 19 May 2017 17:43:38 +0200
From:   Michael Opdenacker <michael.opdenacker@...e-electrons.com>
To:     Bram Vlerick <vlerickb@...il.com>
Cc:     dmitry.torokhov@...il.com, linux-input@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] input: move gpio mouse to managed api

On 19/05/2017 17:35, Bram Vlerick wrote:
> Signed-off-by: Bram Vlerick <vlerickb@...il.com>
> ---
>  drivers/input/mouse/gpio_mouse.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/input/mouse/gpio_mouse.c b/drivers/input/mouse/gpio_mouse.c
> index ced07391304b..7d56fd5173bc 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];
> @@ -154,9 +151,6 @@ static int gpio_mouse_remove(struct platform_device *pdev)
>  	struct gpio_mouse_platform_data *pdata = input->private;
>  	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];
>  		if (pin >= 0)

Reviewed-by: Michael Opdenacker <michael.opdenacker@...e-electrons.com>

-- 
Michael Opdenacker, CEO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ