Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: imx_keypad - check for clk_prepare_enable() error

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>

authored by

Fabio Estevam and committed by
Dmitry Torokhov
e998200c 84c88ef9

+3 -1
+3 -1
drivers/input/keyboard/imx_keypad.c
··· 506 506 input_set_drvdata(input_dev, keypad); 507 507 508 508 /* Ensure that the keypad will stay dormant until opened */ 509 - clk_prepare_enable(keypad->clk); 509 + error = clk_prepare_enable(keypad->clk); 510 + if (error) 511 + return error; 510 512 imx_keypad_inhibit(keypad); 511 513 clk_disable_unprepare(keypad->clk); 512 514