Input: imx_keypad - check the return value from clk_prepare_enable()
Subsystems (3)
Fabio Estevam
reviewerPATCH 2/2 Input: imx_keypad - Simplify devm_kzalloc
In reply to Fabio EstevamFrom: Fabio Estevam <[email protected]>
According to Documentation/CodingStyle:
"The preferred form for passing a size of a struct is the following:
p = kmalloc(sizeof(*p), ...);"
Signed-off-by Fabio Estevam <[email protected]>
--- drivers/input/keyboard/imx_keypad.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/input/keyboard/imx_keypad.c +1 -2
@@ -454,8 +454,7 @@ static int imx_keypad_probe(struct platform_device *pdev)return -ENOMEM ; } - keypad =devm_kzalloc (&pdev->dev,sizeof (struct imx_keypad ), -GFP_KERNEL ); + keypad =devm_kzalloc (&pdev->dev,sizeof (*keypad),GFP_KERNEL );if (!keypad) {dev_err (&pdev->dev,"not enough memory for driver data\n" );return -ENOMEM ;
Signature · 1 line
1.8.1.2
Fabio Estevam
reviewerPATCH 1/2 Input: imx_keypad - check the return value from clk_prepare_enable()
From: Fabio Estevam <[email protected]>
clk_prepare_enable() may fail, so let's check its return value and propagate it in the case of error.
Signed-off-by Fabio Estevam <[email protected]>
--- drivers/input/keyboard/imx_keypad.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/input/keyboard/imx_keypad.c +3 -1
@@ -512,7 +512,9 @@ static int imx_keypad_probe(struct platform_device *pdev)input_set_drvdata (input_dev, keypad);/* Ensure that the keypad will stay dormant until opened */ -clk_prepare_enable (keypad->clk); + error =clk_prepare_enable (keypad->clk); +if (error) +return error;imx_keypad_inhibit (keypad);clk_disable_unprepare (keypad->clk);
Signature · 1 line
1.8.1.2