linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: imx_keypad - check for clk_prepare_enable() error
@ 2015-06-22  4:01 Fabio Estevam
  2015-06-22 16:23 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2015-06-22  4:01 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, Fabio Estevam

From: Fabio Estevam <fabio.estevam@freescale.com>

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>
---
 drivers/input/keyboard/imx_keypad.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c
index 2e855e6..d2ea863 100644
--- a/drivers/input/keyboard/imx_keypad.c
+++ b/drivers/input/keyboard/imx_keypad.c
@@ -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);
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Input: imx_keypad - check for clk_prepare_enable() error
  2015-06-22  4:01 [PATCH] Input: imx_keypad - check for clk_prepare_enable() error Fabio Estevam
@ 2015-06-22 16:23 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2015-06-22 16:23 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: linux-input, Fabio Estevam

On Mon, Jun 22, 2015 at 01:01:18AM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> 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>

Applied, thank you.

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

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-22 16:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-22  4:01 [PATCH] Input: imx_keypad - check for clk_prepare_enable() error Fabio Estevam
2015-06-22 16:23 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).