From: Jonathan Cameron <jic23@kernel.org>
To: "Nuno Sá" <noname.nuno@gmail.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
nuno.sa@analog.com, linux-iio@vger.kernel.org,
devicetree@vger.kernel.org, Lars-Peter Clausen <lars@metafoo.de>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Frank Rowand <frowand.list@gmail.com>,
Olivier Moysan <olivier.moysan@foss.st.com>
Subject: Re: [PATCH v9 6/7] iio: adc: ad9467: convert to backend framework
Date: Sat, 10 Feb 2024 16:31:51 +0000 [thread overview]
Message-ID: <20240210163151.37c31016@jic23-huawei> (raw)
In-Reply-To: <18a89feff869edb9bef6c5d7ffdbc7baadf2cfee.camel@gmail.com>
On Wed, 07 Feb 2024 10:23:36 +0100
Nuno Sá <noname.nuno@gmail.com> wrote:
> On Tue, 2024-02-06 at 19:51 +0200, Andy Shevchenko wrote:
> > On Tue, Feb 6, 2024 at 6:51 PM Nuno Sá <noname.nuno@gmail.com> wrote:
> > > On Tue, 2024-02-06 at 16:20 +0200, Andy Shevchenko wrote:
> > > > On Tue, Feb 6, 2024 at 12:08 PM Nuno Sa via B4 Relay
> > > > <devnull+nuno.sa.analog.com@kernel.org> wrote:
> >
> > ...
> >
> > > > > + st->back = devm_iio_backend_get(&st->spi->dev, NULL);
> > > > > + /* If not found, don't error out as we might have legacy DT
> > > > > property */
> > > > > + if (!IS_ERR(st->back))
> > > > > + return 0;
> > > > > + if (PTR_ERR(st->back) != -ENOENT)
> > > > > + return PTR_ERR(st->back);
> > > >
> > > > This looks hackish...
> > >
> > > This was suggested by Jonathan so I'm keen in leaving it as-is
> >
> > I think I proposed how to improve it. Jonathan?
> >
>
> Well, you did change it around so that we have the typical 'if (ret)' pattern.
> But, honestly, that is also bringing an arguably useless helper. So, yes,
> currently we are not doing the typical "check for errors first" pattern but I do
> think that the code is perfectly fine and readable as it is.
>
> It's also already pretty late in the review process of the series and there was
> already some back and forth so to me, the above is really a minor detail and I'm
> not keen on changing it at this stage (unless Jonathan really feels strong about
> doing it).
It's odd code I don't expect to see anywhere else, so I'm not that fussed if
it takes a little more thinking than normal (and you have a comment there to help
us!)
So I'm fine with leaving this as it stands
Jonathan
>
> I'll spin a v10 with your dev_err_probe() suggestion later today but at this
> point I would prefer to not have to spin another one (afterwards) unless really
> needed (meaning, not because of minor details).
>
> - Nuno Sá
next prev parent reply other threads:[~2024-02-10 16:32 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-06 10:08 [PATCH v9 0/7] iio: add new backend framework Nuno Sa via B4 Relay
2024-02-06 10:08 ` [PATCH v9 1/7] dt-bindings: adc: ad9467: add new io-backend property Nuno Sa via B4 Relay
2024-02-06 10:08 ` [PATCH v9 2/7] dt-bindings: adc: axi-adc: update bindings for backend framework Nuno Sa via B4 Relay
2024-02-06 10:08 ` [PATCH v9 3/7] of: property: add device link support for io-backends Nuno Sa via B4 Relay
2024-02-06 10:08 ` [PATCH v9 4/7] iio: buffer-dmaengine: export buffer alloc and free functions Nuno Sa via B4 Relay
2024-02-06 10:08 ` [PATCH v9 5/7] iio: add the IIO backend framework Nuno Sa via B4 Relay
2024-02-06 14:27 ` Andy Shevchenko
2024-02-07 9:16 ` Nuno Sá
2024-02-06 10:08 ` [PATCH v9 6/7] iio: adc: ad9467: convert to " Nuno Sa via B4 Relay
2024-02-06 14:20 ` Andy Shevchenko
2024-02-06 14:20 ` Andy Shevchenko
2024-02-06 16:52 ` Nuno Sá
2024-02-06 17:50 ` Andy Shevchenko
2024-02-07 12:08 ` Nuno Sá
2024-02-06 16:51 ` Nuno Sá
2024-02-06 17:51 ` Andy Shevchenko
2024-02-07 9:23 ` Nuno Sá
2024-02-10 16:31 ` Jonathan Cameron [this message]
2024-02-06 10:08 ` [PATCH v9 7/7] iio: adc: adi-axi-adc: move " Nuno Sa via B4 Relay
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=20240210163151.37c31016@jic23-huawei \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=andy.shevchenko@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=noname.nuno@gmail.com \
--cc=nuno.sa@analog.com \
--cc=olivier.moysan@foss.st.com \
--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