Skip to content

Commit

Permalink
Input: imx_keypad - check for clk_prepare_enable() error
Browse files Browse the repository at this point in the history
clk_prepare_enable() may fail, so we should better check its return value
and propagate it in the case of error.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Fabio Estevam authored and Dmitry Torokhov committed Jun 22, 2015
1 parent 84c88ef commit e998200
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/input/keyboard/imx_keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,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);

Expand Down

0 comments on commit e998200

Please sign in to comment.