Input: imx_keypad - check for clk_prepare_enable() error
authorFabio Estevam <fabio.estevam@freescale.com>
Mon, 22 Jun 2015 16:22:34 +0000 (09:22 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 22 Jun 2015 16:33:51 +0000 (09:33 -0700)
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>
drivers/input/keyboard/imx_keypad.c

index 2e855e6..d2ea863 100644 (file)
@@ -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);