From: Jonathan Cameron <jic23@kernel.org>
To: Petre Rodan <petre.rodan@subdimension.ro>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
Lars-Peter Clausen <lars@metafoo.de>,
Angel Iglesias <ang.iglesiasg@gmail.com>,
Matti Vaittinen <mazziesaccount@gmail.com>,
Andreas Klinger <ak@it-klinger.de>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Subject: Re: [PATCH 2/2] iio: pressure: driver for Honeywell HSC/SSC series pressure sensors
Date: Sat, 25 Nov 2023 19:13:43 +0000 [thread overview]
Message-ID: <20231125191343.30fc4825@jic23-huawei> (raw)
In-Reply-To: <ZV2a213oidterHYZ@sunspire>
On Wed, 22 Nov 2023 08:08:27 +0200
Petre Rodan <petre.rodan@subdimension.ro> wrote:
> hello,
>
> first of all, thank you for the code review.
> in the interest of brevity I will skip all comments where I simply remove the block, blankline, or fix indentation.
>
> On Mon, Nov 20, 2023 at 02:35:39PM +0200, Andy Shevchenko wrote:
> > > + select HSC030PA_I2C if (I2C)
> > > + select HSC030PA_SPI if (SPI_MASTER)
> >
> > Unneeded parentheses
>
> ack
Where you agree, just crop it out. Saves on scrolling!
> > > + case IIO_CHAN_INFO_RAW:
> > > + mutex_lock(&data->lock);
> > > + ret = hsc_get_measurement(data);
> > > + mutex_unlock(&data->lock);
> >
> > Use guard() operator from cleanup.h.
>
> I'm not familiar with that, for the time being I'll stick to mutex_lock/unlock if you don't mind.
>
It's simple and worth taking a look for new drivers as it makes some error paths much much simpler.
I'm sitting on a big set that applies it to quite few IIO drivers.
> > > + ret = devm_regulator_get_enable_optional(dev, "vdd");
> > > + if (ret == -EPROBE_DEFER)
> > > + return -EPROBE_DEFER;
> >
> > Oh, boy, this should check for ENODEV or so, yeah, regulator APIs a bit
> > interesting.
>
> since I'm unable to test this I'd rather remove the block altogether.
> if I go the ENODEV route my module will never load since I can't see any vdd-supply support on my devboard.
Problem here is why do you think that regulator is optional? Does your device
work with out power? What is optional is whether the regulator is fixed and
on and hence doesn't need to be in DT or whether it is specified there.
That's unconnected to the enabling in driver.
The call you have here is for when the power supply really is optional.
That is the driver does something different if nothing is supplied on the pin.
Typically this is used when we have option of either an internal reference voltage
or supplying an external one. The absence on an external one means we fallback
to only enabling the internal one.
Jonathan
next prev parent reply other threads:[~2023-11-25 19:13 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-17 16:42 [PATCH 1/2] dt-bindings: iio: pressure: add honeywell,hsc030 Petre Rodan
2023-11-17 16:42 ` [PATCH 2/2] iio: pressure: driver for Honeywell HSC/SSC series pressure sensors Petre Rodan
2023-11-18 5:21 ` [PATCH v2 " kernel test robot
2023-11-20 12:35 ` [PATCH " Andy Shevchenko
2023-11-22 6:08 ` Petre Rodan
2023-11-22 10:45 ` Andy Shevchenko
2023-11-25 19:15 ` Jonathan Cameron
2023-11-25 19:13 ` Jonathan Cameron [this message]
2023-11-17 17:12 ` [PATCH 1/2] dt-bindings: iio: pressure: add honeywell,hsc030 Rob Herring
2023-11-17 19:22 ` [PATCH v2 " Petre Rodan
2023-11-17 20:13 ` Rob Herring
2023-11-19 13:49 ` Rob Herring
2023-11-19 20:14 ` Petre Rodan
2023-11-20 10:15 ` Krzysztof Kozlowski
2023-11-20 17:19 ` Rob Herring
2023-11-20 18:09 ` Petre Rodan
2023-11-20 10:21 ` Krzysztof Kozlowski
2023-11-20 13:42 ` Petre Rodan
2023-11-20 14:04 ` Krzysztof Kozlowski
2023-11-20 14:40 ` Petre Rodan
2023-11-20 17:39 ` Jonathan Cameron
2023-11-20 18:25 ` Petre Rodan
2023-11-25 19:21 ` Jonathan Cameron
2023-11-25 19:19 ` 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=20231125191343.30fc4825@jic23-huawei \
--to=jic23@kernel.org \
--cc=ak@it-klinger.de \
--cc=andriy.shevchenko@linux.intel.com \
--cc=ang.iglesiasg@gmail.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mazziesaccount@gmail.com \
--cc=petre.rodan@subdimension.ro \
--cc=robh+dt@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