diff mbox

[2/2] Input: imx_keypad - Omit error message devm_kzalloc() failure

Message ID 1392433187-7756-2-git-send-email-festevam@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Fabio Estevam Feb. 15, 2014, 2:59 a.m. UTC
From: Fabio Estevam <fabio.estevam@freescale.com>

There is no need to print an error message in the driver for devm_kzalloc()
failure because OOM core code handles it properly.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/input/keyboard/imx_keypad.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Dmitry Torokhov Feb. 17, 2014, 7:34 p.m. UTC | #1
On Sat, Feb 15, 2014 at 12:59:47AM -0200, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> There is no need to print an error message in the driver for devm_kzalloc()
> failure because OOM core code handles it properly.

I'd rather keep this in. We may change OOM messaging at later time
making it less verbose.

> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  drivers/input/keyboard/imx_keypad.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c
> index de07035..40ad98d 100644
> --- a/drivers/input/keyboard/imx_keypad.c
> +++ b/drivers/input/keyboard/imx_keypad.c
> @@ -450,10 +450,8 @@ static int imx_keypad_probe(struct platform_device *pdev)
>  
>  	keypad = devm_kzalloc(&pdev->dev, sizeof(struct imx_keypad),
>  			     GFP_KERNEL);
> -	if (!keypad) {
> -		dev_err(&pdev->dev, "not enough memory for driver data\n");
> +	if (!keypad)
>  		return -ENOMEM;
> -	}
>  
>  	keypad->input_dev = input_dev;
>  	keypad->irq = irq;
> -- 
> 1.8.1.2
>
diff mbox

Patch

diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c
index de07035..40ad98d 100644
--- a/drivers/input/keyboard/imx_keypad.c
+++ b/drivers/input/keyboard/imx_keypad.c
@@ -450,10 +450,8 @@  static int imx_keypad_probe(struct platform_device *pdev)
 
 	keypad = devm_kzalloc(&pdev->dev, sizeof(struct imx_keypad),
 			     GFP_KERNEL);
-	if (!keypad) {
-		dev_err(&pdev->dev, "not enough memory for driver data\n");
+	if (!keypad)
 		return -ENOMEM;
-	}
 
 	keypad->input_dev = input_dev;
 	keypad->irq = irq;