All of lore.kernel.org
 help / color / mirror / Atom feed
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 16:27:10 +0200	[thread overview]
Message-ID: <YiDQPm5ggtjl1JmX@smile.fi.intel.com> (raw)
In-Reply-To: <YiDPZbHkwABl2GBE@smile.fi.intel.com>

On Thu, Mar 03, 2022 at 04:23:34PM +0200, Andy Shevchenko wrote:
> On Thu, Mar 03, 2022 at 01:31:56PM +0000, Sa, Nuno wrote:
> 
> ...
> 
> > > +	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.
> 
> This is a good catch!
> 
> > As this reference
> > is also optional, we need to nullify ref in case we don't find the
> > it. Otherwise fwnode_handle_put() breaks.
> 
> No, this is not correct. fwnode_handle_put() is ERR_PTR aware.

Oh, the ->put() handles that, but the fwnode_call_void_op() doesn't!

This has to be fixed on fwnode level.

> > 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>

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2022-03-03 14:28 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
2022-03-03 14:53       ` Sa, Nuno
2022-03-03 14:23     ` Andy Shevchenko
2022-03-03 14:27       ` Andy Shevchenko [this message]
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=YiDQPm5ggtjl1JmX@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.