public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Wolfram Sang <wsa@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux ACPI <linux-acpi@vger.kernel.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	linux-i2c <linux-i2c@vger.kernel.org>
Subject: Re: [PATCH] i2c: ACPI: Replace acpi_bus_get_device()
Date: Tue, 1 Feb 2022 22:18:59 +0200	[thread overview]
Message-ID: <YfmVs3SUKpMFM/da@smile.fi.intel.com> (raw)
In-Reply-To: <CAJZ5v0jFBFKMcjYieYCL1LTvRPuM7b8_5nBx0_wnPtobzg==fw@mail.gmail.com>

On Tue, Feb 01, 2022 at 08:01:46PM +0100, Rafael J. Wysocki wrote:
> On Tue, Feb 1, 2022 at 7:44 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > On Tue, Feb 01, 2022 at 07:00:42PM +0100, Rafael J. Wysocki wrote:
> > > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > >
> > > Replace acpi_bus_get_device() that is going to be dropped with
> > > acpi_fetch_acpi_dev().
> > >
> > > No intentional functional impact.
> >
> > ...
> >
> > > +     if (!adev || i2c_acpi_get_info(adev, &info, adapter, NULL))
> >
> > AFAICS the !adev check is redundant since acpi_device_enumerated() does it.
> 
> No.
> 
> acpi_device_enumerated() returns false if adev is NULL, so without
> this extra check i2c_acpi_get_info() will end up passing NULL to
> i2c_acpi_do_lookup().

I see now.

The patch LGTM,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> > >               return AE_OK;
> >
> > ...
> >
> > > +     struct acpi_device *adev = acpi_fetch_acpi_dev(handle);
> > >
> > > -     if (i2c_acpi_do_lookup(adev, lookup))
> > > +     if (!adev || i2c_acpi_do_lookup(adev, lookup))
> > >               return AE_OK;
> >
> > Here we need it indeed.
> > Dunno, if acpi_dev_ready_for_enumeration() can gain the check itself.
> 
> Well, acpi_bus_get_status() would need it too.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2022-02-01 20:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-01 18:00 [PATCH] i2c: ACPI: Replace acpi_bus_get_device() Rafael J. Wysocki
2022-02-01 18:43 ` Andy Shevchenko
2022-02-01 19:01   ` Rafael J. Wysocki
2022-02-01 20:18     ` Andy Shevchenko [this message]
2022-02-02 14:46 ` Mika Westerberg
2022-02-07 16:01 ` Wolfram Sang

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=YfmVs3SUKpMFM/da@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rafael@kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=wsa@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