From: Jonathan Cameron <jic23@kernel.org>
To: Arvind Yadav <arvind.yadav.cs@gmail.com>
Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net,
vz@mleia.com, slemieux.tyco@gmail.com, linux-iio@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio:adc:lpc32xx Handle return value of clk_prepare_enable
Date: Sat, 3 Jun 2017 09:30:19 +0100 [thread overview]
Message-ID: <20170603093019.3cfa04b5@kernel.org> (raw)
In-Reply-To: <e54764708d74134ef1f5b3566b2d4d3ab4187b45.1496045161.git.arvind.yadav.cs@gmail.com>
On Tue, 30 May 2017 16:35:27 +0530
Arvind Yadav <arvind.yadav.cs@gmail.com> 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 to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.
Thanks,
Jonathan
> ---
> drivers/iio/adc/lpc32xx_adc.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/adc/lpc32xx_adc.c b/drivers/iio/adc/lpc32xx_adc.c
> index 0de709b..6a5b9a9 100644
> --- a/drivers/iio/adc/lpc32xx_adc.c
> +++ b/drivers/iio/adc/lpc32xx_adc.c
> @@ -76,10 +76,14 @@ static int lpc32xx_read_raw(struct iio_dev *indio_dev,
> long mask)
> {
> struct lpc32xx_adc_state *st = iio_priv(indio_dev);
> -
> + int ret;
> if (mask == IIO_CHAN_INFO_RAW) {
> mutex_lock(&indio_dev->mlock);
> - clk_prepare_enable(st->clk);
> + ret = clk_prepare_enable(st->clk);
> + if (ret) {
> + mutex_unlock(&indio_dev->mlock);
> + return ret;
> + }
> /* Measurement setup */
> __raw_writel(LPC32XXAD_INTERNAL | (chan->address) |
> LPC32XXAD_REFp | LPC32XXAD_REFm,
prev parent reply other threads:[~2017-06-03 8:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-30 11:05 [PATCH] iio:adc:lpc32xx Handle return value of clk_prepare_enable Arvind Yadav
2017-06-03 8:30 ` Jonathan Cameron [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=20170603093019.3cfa04b5@kernel.org \
--to=jic23@kernel.org \
--cc=arvind.yadav.cs@gmail.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
--cc=slemieux.tyco@gmail.com \
--cc=vz@mleia.com \
/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).