Input: imx_keypad - Propagate the real error code on platform_get_irq() failure
Subsystems (3)
Fabio Estevam
reviewerPATCH 1/2 Input: imx_keypad - Propagate the real error code on platform_get_irq() failure
From: Fabio Estevam <[email protected]>
No need to return a 'fake' return value on platform_get_irq() failure.
Just return the error code itself instead.
--- drivers/input/keyboard/imx_keypad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/keyboard/imx_keypad.c +1 -1
@@ -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);
Signature · 1 line
1.8.1.2
Fabio Estevam
reviewerPATCH 2/2 Input: imx_keypad - Omit error message devm_kzalloc() failure
From: Fabio Estevam <[email protected]>
There is no need to print an error message in the driver for devm_kzalloc() failure because OOM core code handles it properly.
--- drivers/input/keyboard/imx_keypad.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/input/keyboard/imx_keypad.c +1 -3
@@ -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;
Signature · 1 line
1.8.1.2
Dmitry Torokhov
maintainerRe: [PATCH 2/2] Input: imx_keypad - Omit error message devm_kzalloc() failure
Quoted 4 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
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.
Quoted 25 lines
Signed-off-by Fabio Estevam <[email protected]>--- drivers/input/keyboard/imx_keypad.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/input/keyboard/imx_keypad.c +1
-3@@ -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;Signature · 1 line
1.8.1.2
Signature · 1 line
Dmitry
Quoted 7 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
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 <[email protected]>
Applied, thank you.
Quoted 20 lines
--- drivers/input/keyboard/imx_keypad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/input/keyboard/imx_keypad.c +1
-1@@ -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);Signature · 1 line
1.8.1.2
Signature · 1 line
Dmitry