From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Sa, Nuno" <Nuno.Sa@analog.com>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Jonathan Cameron <jic23@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>
Subject: Re: [PATCH v3 3/3] iio: temperature: ltc2983: Make use of device properties
Date: Thu, 3 Mar 2022 15:57:33 +0200 [thread overview]
Message-ID: <YiDJTZECF9FHFIS4@smile.fi.intel.com> (raw)
In-Reply-To: <PH0PR03MB6786304A458CD4B11AF5C42699049@PH0PR03MB6786.namprd03.prod.outlook.com>
On Thu, Mar 03, 2022 at 01:31:56PM +0000, Sa, Nuno wrote:
> Hi Andy,
>
> Good that we waited to test this patch. The fundamental logic change
> for fetching and writing the custom tables are fine. That said, there
> some issues that I had to fix to test the patch. See below...
Thanks and indeed it's a good news that we caught a bug beforehand.
> > From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Sent: Thursday, February 10, 2022 2:55 PM
...
> > - phandle = of_parse_phandle(child, "adi,cold-junction-handle",
> > 0);
> > - if (phandle) {
> > - ret = of_property_read_u32(phandle, "reg",
> > - &thermo-
> > >cold_junction_chan);
> > + ref = fwnode_find_reference(child, "adi,cold-junction-
> > handle", 0);
> > + if (ref) {
>
> This is nok. It needs to be 'if (IS_ERR(ref))'. We then should return
> ERR_CAST() in case of errors inside the if block. As this reference
> is also optional, we need to nullify ref in case we don't find the
> it. Otherwise fwnode_handle_put() breaks.
Got it (I hope).
Lemme go through it again and issue a v4.
> We also need to use ptr error logic in the other places where
> fwnode_find_reference() is used. Although, in the other cases
> the ref is mandatory, so there's no need to care with breaking
> fwnode_handle_put().
>
> After these changes (I think the changes are straight enough;
> but I can re-test if you or Jonathan ask for it):
>
> Tested-by: Nuno Sá <nuno.sa@analog.com>
I think of v4 where I may add this, but still would be nice to re-review and
check if I got correctly your testing report.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2022-03-03 13:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-10 13:55 [PATCH v3 1/3] iio: temperature: ltc2983: Don't hard code defined constants in messages Andy Shevchenko
2022-02-10 13:55 ` [PATCH v3 2/3] iio: temperature: ltc2983: Use single error path to put OF node Andy Shevchenko
2022-02-10 13:55 ` [PATCH v3 3/3] iio: temperature: ltc2983: Make use of device properties Andy Shevchenko
2022-03-03 13:31 ` Sa, Nuno
2022-03-03 13:57 ` Andy Shevchenko [this message]
2022-03-03 14:53 ` Sa, Nuno
2022-03-03 14:23 ` Andy Shevchenko
2022-03-03 14:27 ` Andy Shevchenko
2022-03-03 14:52 ` Sa, Nuno
2022-02-13 17:55 ` [PATCH v3 1/3] iio: temperature: ltc2983: Don't hard code defined constants in messages Jonathan Cameron
2022-02-14 9:23 ` Andy Shevchenko
2022-03-02 15:50 ` Andy Shevchenko
2022-03-02 19:56 ` Nuno Sá
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=YiDJTZECF9FHFIS4@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=Nuno.Sa@analog.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@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