All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Input: imx_keypad - Propagate the real error code on platform_get_irq() failure
@ 2014-02-15  2:59 Fabio Estevam
  2014-02-15  2:59 ` [PATCH 2/2] Input: imx_keypad - Omit error message devm_kzalloc() failure Fabio Estevam
  2014-02-17 19:33 ` [PATCH 1/2] Input: imx_keypad - Propagate the real error code on platform_get_irq() failure Dmitry Torokhov
  0 siblings, 2 replies; 4+ messages in thread
From: Fabio Estevam @ 2014-02-15  2:59 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, Fabio Estevam

From: Fabio Estevam <fabio.estevam@freescale.com>

No need to return a 'fake' return value on platform_get_irq() failure.

Just return the error code itself instead.

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

diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c
index cbf4f80..de07035 100644
--- a/drivers/input/keyboard/imx_keypad.c
+++ b/drivers/input/keyboard/imx_keypad.c
@@ -439,7 +439,7 @@ static int imx_keypad_probe(struct platform_device *pdev)
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
 		dev_err(&pdev->dev, "no irq defined in platform data\n");
-		return -EINVAL;
+		return irq;
 	}
 
 	input_dev = devm_input_allocate_device(&pdev->dev);
-- 
1.8.1.2


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

* [PATCH 2/2] Input: imx_keypad - Omit error message devm_kzalloc() failure
  2014-02-15  2:59 [PATCH 1/2] Input: imx_keypad - Propagate the real error code on platform_get_irq() failure Fabio Estevam
@ 2014-02-15  2:59 ` Fabio Estevam
  2014-02-17 19:34   ` Dmitry Torokhov
  2014-02-17 19:33 ` [PATCH 1/2] Input: imx_keypad - Propagate the real error code on platform_get_irq() failure Dmitry Torokhov
  1 sibling, 1 reply; 4+ messages in thread
From: Fabio Estevam @ 2014-02-15  2:59 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, Fabio Estevam

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(-)

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


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

* Re: [PATCH 1/2] Input: imx_keypad - Propagate the real error code on platform_get_irq() failure
  2014-02-15  2:59 [PATCH 1/2] Input: imx_keypad - Propagate the real error code on platform_get_irq() failure Fabio Estevam
  2014-02-15  2:59 ` [PATCH 2/2] Input: imx_keypad - Omit error message devm_kzalloc() failure Fabio Estevam
@ 2014-02-17 19:33 ` Dmitry Torokhov
  1 sibling, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2014-02-17 19:33 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: linux-input, Fabio Estevam

On Sat, Feb 15, 2014 at 12:59:46AM -0200, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> No need to return a 'fake' return value on platform_get_irq() failure.
> 
> Just return the error code itself instead.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Applied, thank you.

> ---
>  drivers/input/keyboard/imx_keypad.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c
> index cbf4f80..de07035 100644
> --- a/drivers/input/keyboard/imx_keypad.c
> +++ b/drivers/input/keyboard/imx_keypad.c
> @@ -439,7 +439,7 @@ static int imx_keypad_probe(struct platform_device *pdev)
>  	irq = platform_get_irq(pdev, 0);
>  	if (irq < 0) {
>  		dev_err(&pdev->dev, "no irq defined in platform data\n");
> -		return -EINVAL;
> +		return irq;
>  	}
>  
>  	input_dev = devm_input_allocate_device(&pdev->dev);
> -- 
> 1.8.1.2
> 

-- 
Dmitry

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

* Re: [PATCH 2/2] Input: imx_keypad - Omit error message devm_kzalloc() failure
  2014-02-15  2:59 ` [PATCH 2/2] Input: imx_keypad - Omit error message devm_kzalloc() failure Fabio Estevam
@ 2014-02-17 19:34   ` Dmitry Torokhov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2014-02-17 19:34 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: linux-input, Fabio Estevam

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
> 

-- 
Dmitry

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

end of thread, other threads:[~2014-02-17 19:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-15  2:59 [PATCH 1/2] Input: imx_keypad - Propagate the real error code on platform_get_irq() failure Fabio Estevam
2014-02-15  2:59 ` [PATCH 2/2] Input: imx_keypad - Omit error message devm_kzalloc() failure Fabio Estevam
2014-02-17 19:34   ` Dmitry Torokhov
2014-02-17 19:33 ` [PATCH 1/2] Input: imx_keypad - Propagate the real error code on platform_get_irq() failure Dmitry Torokhov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.