Skip to contentSkip to conversation

Input: imx_keypad - check for clk_prepare_enable() error

PATCH Applied Fabio Estevam 2 participants 2 messages Jun 22, 2015

Subsystems (3)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/1 Input: imx_keypad - check for clk_prepare_enable() error

From: Fabio Estevam <[email protected]>

clk_prepare_enable() may fail, so we should better check its return value and propagate it in the case of error.

---
 drivers/input/keyboard/imx_keypad.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/input/keyboard/imx_keypad.c +3 -1
index 2e855e6..d2ea863 100644
@@ -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);
 
Signature · 4 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
maintainer Applied
#1 lore raw
Quoted 6 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

clk_prepare_enable() may fail, so we should better check its return value and propagate it in the case of error.

Applied, thank you.

Quoted 22 lines
---
 drivers/input/keyboard/imx_keypad.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/input/keyboard/imx_keypad.c +3 -1
index 2e855e6..d2ea863 100644
@@ -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);
 
Signature · 1 line
1.9.1
Signature · 3 lines
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in