diff mbox

Input: snvs_pwrkey - drop input_free_device call if input_register_device fails

Message ID 1474249756-30843-1-git-send-email-axel.lin@ingics.com (mailing list archive)
State Accepted
Headers show

Commit Message

Axel Lin Sept. 19, 2016, 1:49 a.m. UTC
Current code uses devm_input_allocate_device() so don't explicitly call
input_free_device if input_register_device fails.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/input/keyboard/snvs_pwrkey.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Dmitry Torokhov Sept. 23, 2016, 10:01 p.m. UTC | #1
On Mon, Sep 19, 2016 at 09:49:16AM +0800, Axel Lin wrote:
> Current code uses devm_input_allocate_device() so don't explicitly call
> input_free_device if input_register_device fails.
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>

Applied, thank you.

> ---
>  drivers/input/keyboard/snvs_pwrkey.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/input/keyboard/snvs_pwrkey.c b/drivers/input/keyboard/snvs_pwrkey.c
> index 24a9f59..7544888 100644
> --- a/drivers/input/keyboard/snvs_pwrkey.c
> +++ b/drivers/input/keyboard/snvs_pwrkey.c
> @@ -168,7 +168,6 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
>  	error = input_register_device(input);
>  	if (error < 0) {
>  		dev_err(&pdev->dev, "failed to register input device\n");
> -		input_free_device(input);
>  		return error;
>  	}
>  
> -- 
> 2.7.4
>
diff mbox

Patch

diff --git a/drivers/input/keyboard/snvs_pwrkey.c b/drivers/input/keyboard/snvs_pwrkey.c
index 24a9f59..7544888 100644
--- a/drivers/input/keyboard/snvs_pwrkey.c
+++ b/drivers/input/keyboard/snvs_pwrkey.c
@@ -168,7 +168,6 @@  static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
 	error = input_register_device(input);
 	if (error < 0) {
 		dev_err(&pdev->dev, "failed to register input device\n");
-		input_free_device(input);
 		return error;
 	}