From: Matti Vaittinen <mazziesaccount@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: "Matti Vaittinen" <matti.vaittinen@fi.rohmeurope.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Bartosz Golaszewski" <brgl@bgdev.pl>,
"Marcelo Schmitt" <marcelo.schmitt@analog.com>,
"Javier Carrasco" <javier.carrasco.cruz@gmail.com>,
"Tobias Sperling" <tobias.sperling@softing.com>,
"Antoniu Miclaus" <antoniu.miclaus@analog.com>,
"Trevor Gamblin" <tgamblin@baylibre.com>,
"Esteban Blanc" <eblanc@baylibre.com>,
"Ramona Alexandra Nechita" <ramona.nechita@analog.com>,
"Thomas Bonnefille" <thomas.bonnefille@bootlin.com>,
"Hans de Goede" <hansg@kernel.org>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org
Subject: Re: [PATCH 2/3] iio: adc: Support ROHM BD79112 ADC/GPIO
Date: Fri, 5 Sep 2025 08:47:44 +0300 [thread overview]
Message-ID: <37f9c6bd-f3b2-4258-a455-c4b08023d8a9@gmail.com> (raw)
In-Reply-To: <aLb8HuIG0XXLu653@smile.fi.intel.com>
On 02/09/2025 17:15, Andy Shevchenko wrote:
>> + ret = devm_iio_adc_device_alloc_chaninfo_se(dev, &bd79112_chan_template,
>> + BD79112_MAX_NUM_CHANNELS - 1, &cs);
>
> Hmm... Indentation can be amended.
>
>> + if (ret < 0) {
>
> Why ' < 0' ?
>
>> + /* Register all pins as GPIOs if there are no ADC channels */
>> + if (ret == -ENOENT)
>> + goto register_gpios;
>> +
>> + return ret;
>> + }
>
> Assuming ret can't be positive this can be refactored as:
I returned back to this after reading your comment to v2.
ret can be positive.
>
> /* Register all pins as GPIOs if there are no ADC channels */
> if (ret == -ENOENT)
> goto register_gpios;
> else if (ret)
> return ret;
>
> I find it easier to follow.
I still kinda like your suggestion. I'll change this to something like
below for v3:
/* Register all pins as GPIOs if there are no ADC channels */
if (ret == -ENOENT)
goto register_gpios;
if (ret < 0)
return ret;
Thanks again!
Yours,
-- Matti
next prev parent reply other threads:[~2025-09-05 5:47 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-02 12:23 [PATCH 0/3] Support ROHM BD79112 ADC Matti Vaittinen
2025-09-02 12:23 ` [PATCH 1/3] dt-bindings: iio: adc: ROHM BD79112 ADC/GPIO Matti Vaittinen
2025-09-02 17:57 ` Rob Herring (Arm)
2025-09-02 12:24 ` [PATCH 2/3] iio: adc: Support " Matti Vaittinen
2025-09-02 14:15 ` Andy Shevchenko
2025-09-03 6:52 ` Matti Vaittinen
2025-09-03 11:23 ` Andy Shevchenko
2025-09-03 12:14 ` Matti Vaittinen
2025-09-03 13:29 ` Andy Shevchenko
2025-09-04 12:35 ` Matti Vaittinen
2025-09-04 13:04 ` Andy Shevchenko
2025-09-05 5:47 ` Matti Vaittinen [this message]
2025-09-02 15:14 ` David Lechner
2025-09-03 7:03 ` Matti Vaittinen
2025-09-02 22:34 ` Linus Walleij
2025-09-03 5:23 ` Matti Vaittinen
2025-09-03 6:47 ` Linus Walleij
2025-09-03 7:17 ` Matti Vaittinen
2025-09-03 7:17 ` Matti Vaittinen
2025-09-03 8:17 ` Matti Vaittinen
2025-09-03 11:02 ` Nuno Sá
2025-09-03 11:27 ` Andy Shevchenko
2025-09-04 14:02 ` kernel test robot
2025-09-02 12:30 ` [PATCH 3/3] MAINTAINERS: Support ROHM BD79112 ADC Matti Vaittinen
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=37f9c6bd-f3b2-4258-a455-c4b08023d8a9@gmail.com \
--to=mazziesaccount@gmail.com \
--cc=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=antoniu.miclaus@analog.com \
--cc=brgl@bgdev.pl \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=eblanc@baylibre.com \
--cc=hansg@kernel.org \
--cc=javier.carrasco.cruz@gmail.com \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.schmitt@analog.com \
--cc=matti.vaittinen@fi.rohmeurope.com \
--cc=nuno.sa@analog.com \
--cc=ramona.nechita@analog.com \
--cc=robh@kernel.org \
--cc=tgamblin@baylibre.com \
--cc=thomas.bonnefille@bootlin.com \
--cc=tobias.sperling@softing.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).