From: dmitry.torokhov@gmail.com (Dmitry Torokhov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] Input: s3c2410_ts - Handle return value of clk_prepare_enable
Date: Tue, 30 May 2017 09:48:45 -0700 [thread overview]
Message-ID: <20170530164845.GC12922@dtor-ws> (raw)
In-Reply-To: <477d9b0992f4b16454ad1780eb4477433c075226.1496141406.git.arvind.yadav.cs@gmail.com>
On Tue, May 30, 2017 at 04:22:57PM +0530, Arvind Yadav wrote:
> clk_prepare_enable() can fail here and we must check its return value.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Applied, thank you.
> ---
> drivers/input/touchscreen/s3c2410_ts.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c
> index 41d58e8..3b3db8c 100644
> --- a/drivers/input/touchscreen/s3c2410_ts.c
> +++ b/drivers/input/touchscreen/s3c2410_ts.c
> @@ -264,7 +264,11 @@ static int s3c2410ts_probe(struct platform_device *pdev)
> return -ENOENT;
> }
>
> - clk_prepare_enable(ts.clock);
> + ret = clk_prepare_enable(ts.clock);
> + if (ret) {
> + dev_err(dev, "Failed! to enabled clocks\n");
> + goto err_clk_get;
> + }
> dev_dbg(dev, "got and enabled clocks\n");
>
> ts.irq_tc = ret = platform_get_irq(pdev, 0);
> @@ -353,7 +357,9 @@ static int s3c2410ts_probe(struct platform_device *pdev)
> err_iomap:
> iounmap(ts.io);
> err_clk:
> + clk_disable_unprepare(ts.clock);
> del_timer_sync(&touch_timer);
> + err_clk_get:
> clk_put(ts.clock);
> return ret;
> }
> --
> 1.9.1
>
--
Dmitry
prev parent reply other threads:[~2017-05-30 16:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-30 10:52 [PATCH] Input: s3c2410_ts - Handle return value of clk_prepare_enable Arvind Yadav
2017-05-30 16:48 ` 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=20170530164845.GC12922@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=linux-arm-kernel@lists.infradead.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).