From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Fabio Estevam <festevam@gmail.com>
Cc: haibo.chen@nxp.com, linux-input@vger.kernel.org,
Fabio Estevam <fabio.estevam@nxp.com>
Subject: Re: [PATCH] Input: imx6ul_tsc - fix error handling
Date: Wed, 12 Apr 2017 08:43:50 -0700 [thread overview]
Message-ID: <20170412154350.GD6297@dtor-ws> (raw)
In-Reply-To: <1491996010-19947-1-git-send-email-festevam@gmail.com>
On Wed, Apr 12, 2017 at 08:20:10AM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@nxp.com>
>
> If imx6ul_tsc_init() fails we should not return directly.
>
> We should disable the previously acquired clocks in this case.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Applied, thank you.
> ---
> drivers/input/touchscreen/imx6ul_tsc.c | 15 ++++++++++++---
> 1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/input/touchscreen/imx6ul_tsc.c b/drivers/input/touchscreen/imx6ul_tsc.c
> index 7098e0a..ee82a97 100644
> --- a/drivers/input/touchscreen/imx6ul_tsc.c
> +++ b/drivers/input/touchscreen/imx6ul_tsc.c
> @@ -337,11 +337,20 @@ static int imx6ul_tsc_open(struct input_dev *input_dev)
> dev_err(tsc->dev,
> "Could not prepare or enable the tsc clock: %d\n",
> err);
> - clk_disable_unprepare(tsc->adc_clk);
> - return err;
> + goto disable_adc_clk;
> }
>
> - return imx6ul_tsc_init(tsc);
> + err = imx6ul_tsc_init(tsc);
> + if (err)
> + goto disable_tsc_clk;
> +
> + return 0;
> +
> +disable_tsc_clk:
> + clk_disable_unprepare(tsc->tsc_clk);
> +disable_adc_clk:
> + clk_disable_unprepare(tsc->adc_clk);
> + return err;
> }
>
> static void imx6ul_tsc_close(struct input_dev *input_dev)
> --
> 2.7.4
>
--
Dmitry
prev parent reply other threads:[~2017-04-12 15:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-12 11:20 [PATCH] Input: imx6ul_tsc - fix error handling Fabio Estevam
2017-04-12 15:43 ` Dmitry Torokhov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170412154350.GD6297@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=fabio.estevam@nxp.com \
--cc=festevam@gmail.com \
--cc=haibo.chen@nxp.com \
--cc=linux-input@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).