From: Jonathan Cameron <jic23@kernel.org>
To: Tomer Maimon <tmaimon77@gmail.com>
Cc: gregkh@linuxfoundation.org, knaack.h@gmx.de, lars@metafoo.de,
pmeerw@pmeerw.net, yuenn@google.com, venture@google.com,
brendanhiggins@google.com, avifishman70@gmail.com,
joel@jms.id.au, linux-iio@vger.kernel.org,
openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] iio: adc: modify NPCM ADC read reference voltage
Date: Sun, 7 Apr 2019 11:28:03 +0100 [thread overview]
Message-ID: <20190407112803.5de7b4c2@archlinux> (raw)
In-Reply-To: <20190407081928.72250-1-tmaimon77@gmail.com>
On Sun, 7 Apr 2019 11:19:28 +0300
Tomer Maimon <tmaimon77@gmail.com> wrote:
> Checking if regulator is valid before reading
> NPCM ADC regulator voltage to avoid system crash
> in a case the regulator is not valid.
>
> Signed-off-by: Tomer Maimon <tmaimon77@gmail.com>
Good catch.
Applied to the fixes-togreg branch of iio.git and marked for
stable.
Thanks,
Jonathan
> ---
> drivers/iio/adc/npcm_adc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/npcm_adc.c b/drivers/iio/adc/npcm_adc.c
> index 9e25bbec9c70..193b3b81de4d 100644
> --- a/drivers/iio/adc/npcm_adc.c
> +++ b/drivers/iio/adc/npcm_adc.c
> @@ -149,7 +149,7 @@ static int npcm_adc_read_raw(struct iio_dev *indio_dev,
> }
> return IIO_VAL_INT;
> case IIO_CHAN_INFO_SCALE:
> - if (info->vref) {
> + if (!IS_ERR(info->vref)) {
> vref_uv = regulator_get_voltage(info->vref);
> *val = vref_uv / 1000;
> } else {
prev parent reply other threads:[~2019-04-07 10:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-07 8:19 [PATCH v1] iio: adc: modify NPCM ADC read reference voltage Tomer Maimon
2019-04-07 10:28 ` 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=20190407112803.5de7b4c2@archlinux \
--to=jic23@kernel.org \
--cc=avifishman70@gmail.com \
--cc=brendanhiggins@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=joel@jms.id.au \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=openbmc@lists.ozlabs.org \
--cc=pmeerw@pmeerw.net \
--cc=tmaimon77@gmail.com \
--cc=venture@google.com \
--cc=yuenn@google.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).