[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0jTz_-CKhX+W+ud5iVPprnx0Rp0YbEd4TOsZZ7i_psYnA@mail.gmail.com>
Date: Wed, 29 Jun 2022 15:38:33 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: John Garry <john.garry@...wei.com>
Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>,
Linux ACPI <linux-acpi@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH] hisi_lpc: Use acpi_dev_for_each_child()
On Wed, Jun 29, 2022 at 3:34 PM John Garry <john.garry@...wei.com> wrote:
>
> On 29/06/2022 13:55, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> >
> > Instead of walking the list of children of an ACPI device directly,
> > use acpi_dev_for_each_child() to carry out an action for all of
> > the given ACPI device's children.
> >
> > This will help to eliminate the children list head from struct
> > acpi_device as it is redundant and it is used in questionable ways
> > in some places (in particular, locking is needed for walking the
> > list pointed to it safely, but it is often missing).
> >
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
>
> Hi Rafael,
>
> > ---
> > drivers/bus/hisi_lpc.c | 12 ++++++++----
> > 1 file changed, 8 insertions(+), 4 deletions(-)
> >
> > Index: linux-pm/drivers/bus/hisi_lpc.c
> > ===================================================================
> > --- linux-pm.orig/drivers/bus/hisi_lpc.c
> > +++ linux-pm/drivers/bus/hisi_lpc.c
> > @@ -471,6 +471,12 @@ static int hisi_lpc_acpi_remove_subdev(s
> > return 0;
> > }
> >
> > +static int hisi_lpc_acpi_clear_enumerated(struct acpi_device *adev, void *not_used)
> > +{
> > + acpi_device_clear_enumerated(adev);
> > + return 0;
> > +}
> > +
> > struct hisi_lpc_acpi_cell {
> > const char *hid;
> > const char *name;
> > @@ -480,13 +486,11 @@ struct hisi_lpc_acpi_cell {
> >
> > static void hisi_lpc_acpi_remove(struct device *hostdev)
> > {
> > - struct acpi_device *adev = ACPI_COMPANION(hostdev);
> > struct acpi_device *child;
> >
> I got this warn:
>
> drivers/bus/hisi_lpc.c: In function ‘hisi_lpc_acpi_remove’:
> drivers/bus/hisi_lpc.c:489:22: warning: unused variable ‘child’
> [-Wunused-variable]
> 489 | struct acpi_device *child;
> | ^~~~~
> CC drivers/bus/brcmstb_gisb.
I've overlooked that, sorry. Will send a v2 fixing this shortly.
> With that fixed:
>
> Acked-by: John Garry <john.garry@...wei.com>
Thanks!
> Can you route this through one of your trees?
Yes, I will do that.
Powered by blists - more mailing lists