linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Renato Lui Geh <renatogeh@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Renato Lui Geh <renatogeh@gmail.com>,
	lars@metafoo.de, Michael.Hennerich@analog.com, knaack.h@gmx.de,
	pmeerw@pmeerw.net, gregkh@linuxfoundation.org,
	alexandru.Ardelean@analog.com, stefan.popa@analog.com,
	giuliano.belinassi@usp.br, linux-iio@vger.kernel.org,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	kernel-usp@googlegroups.com
Subject: Re: [PATCH v2 1/2] staging: iio: ad7780: update voltage on read
Date: Sun, 28 Oct 2018 13:52:32 -0300	[thread overview]
Message-ID: <20181028165231.2det3cq3u7r6qoxj@renatolg> (raw)
In-Reply-To: <20181028155611.67abeafb@archlinux>

Hi Jonathan,

Thank you for the review.

>> +		voltage_uv = regulator_get_voltage(st->reg);
>> +		if (voltage_uv)
>> +			st->int_vref_mv = voltage_uv/1000;
>>  		*val = st->int_vref_mv * st->gain;
>Is there actually a reason (now) to have the stashed value
>of int_vref_mv in the state structure?

From probe:

if (voltage_uv)
	st->int_vref_mv = voltage_uv / 1000;
else
	dev_warn(&spi->dev, "Reference voltage unspecified\n");

So the idea was to, when voltage_uv = 0, return the previous voltage.
Should I instead handle this as an error the same way as in probe?

Thanks,
Renato

  reply	other threads:[~2018-10-28 16:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-25 22:29 [PATCH v2 0/2] staging: iio: ad7780: correct driver read Renato Lui Geh
2018-10-25 22:30 ` [PATCH v2 1/2] staging: iio: ad7780: update voltage on read Renato Lui Geh
2018-10-28 15:56   ` Jonathan Cameron
2018-10-28 16:52     ` Renato Lui Geh [this message]
2018-10-28 18:58       ` Jonathan Cameron
2018-10-25 22:30 ` [PATCH v2 2/2] staging: iio: ad7780: fix offset read value Renato Lui Geh
2018-10-28 15:58   ` Jonathan Cameron

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=20181028165231.2det3cq3u7r6qoxj@renatolg \
    --to=renatogeh@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=alexandru.Ardelean@analog.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=giuliano.belinassi@usp.br \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@kernel.org \
    --cc=kernel-usp@googlegroups.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=stefan.popa@analog.com \
    --subject='Re: [PATCH v2 1/2] staging: iio: ad7780: update voltage on read' \
    /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

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).