From: Eugene Zaikonnikov <eugene.zaikonnikov@norphonic.com>
To: Jonathan Cameron <jic23@kernel.org>,
Eugene Zalkonnikov <ez@norphonic.com>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
"development@norphonic.com" <development@norphonic.com>,
"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Subject: Re: [PATCH v3 1/2] Driver for TI HDC20x0 humidity and temperature sensors
Date: Tue, 21 Jan 2020 08:45:21 +0000 [thread overview]
Message-ID: <9d866c18-6643-f76f-df7e-6f29f01274da@norphonic.com> (raw)
In-Reply-To: <20191223171627.1179f88b@archlinux>
Hi Jonathan,
On 23.12.2019 18:16, Jonathan Cameron wrote:
>
> As below. Why change the existing return value?
>
>> + }
>> + return ret;
>> + }
>> + case IIO_CHAN_INFO_PEAK: {
>> + int ret;
>> +
>> + ret = iio_device_claim_direct_mode(indio_dev);
>> + if (ret)
>> + return ret;
>> + mutex_lock(&data->lock);
>> + ret = hdc2010_get_measurement_byte(data, chan);
>> + mutex_unlock(&data->lock);
>> + iio_device_release_direct_mode(indio_dev);
>> + if (ret >= 0) {
>> + /* Scaling up the value so we can use same offset as RAW */
>> + *val = ret * 256;
>> + ret = IIO_VAL_INT;
>> + } else
> Why overwrite ret? That might provide better information
> on what went wrong.
As with the other stylistic notes before, no good reason other than how it was handled in other drivers in the tree. So I assumed it was the practice. Will tidy up later this week I hope and send a new patchset.
--
Eugene
next prev parent reply other threads:[~2020-01-21 8:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-13 15:55 [PATCH v3 1/2] Driver for TI HDC20x0 humidity and temperature sensors Eugene Zalkonnikov
2019-12-13 15:57 ` [PATCH v3 2/2] Device tree bindings " Eugene Zalkonnikov
2019-12-23 17:11 ` Jonathan Cameron
2019-12-23 17:16 ` [PATCH v3 1/2] Driver " Jonathan Cameron
2020-01-21 8:45 ` Eugene Zaikonnikov [this message]
2020-01-27 12:06 ` 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=9d866c18-6643-f76f-df7e-6f29f01274da@norphonic.com \
--to=eugene.zaikonnikov@norphonic.com \
--cc=development@norphonic.com \
--cc=ez@norphonic.com \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@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).