From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Linux ACPI <linux-acpi@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Linux PM <linux-pm@vger.kernel.org>,
Linux PCI <linux-pci@vger.kernel.org>,
Bjorn Helgaas <helgaas@kernel.org>,
Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: [PATCH v1 1/3] ACPI: bus: Introduce acpi_dev_for_each_child()
Date: Mon, 04 Apr 2022 17:21:50 +0200 [thread overview]
Message-ID: <3679769.kQq0lBPeGt@kreacher> (raw)
In-Reply-To: <21439956.EfDdHjke4D@kreacher>
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Introduce a wrapper around device_for_each_child() to iterate over
the children of a given ACPI device object.
This function will be used in subsequent change sets.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/acpi/bus.c | 6 ++++++
include/acpi/acpi_bus.h | 2 ++
2 files changed, 8 insertions(+)
Index: linux-pm/drivers/acpi/bus.c
===================================================================
--- linux-pm.orig/drivers/acpi/bus.c
+++ linux-pm/drivers/acpi/bus.c
@@ -1070,6 +1070,12 @@ int acpi_bus_for_each_dev(int (*fn)(stru
}
EXPORT_SYMBOL_GPL(acpi_bus_for_each_dev);
+int acpi_dev_for_each_child(struct acpi_device *adev,
+ int (*fn)(struct device *, void *), void *data)
+{
+ return device_for_each_child(&adev->dev, data, fn);
+}
+
/* --------------------------------------------------------------------------
Initialization/Cleanup
-------------------------------------------------------------------------- */
Index: linux-pm/include/acpi/acpi_bus.h
===================================================================
--- linux-pm.orig/include/acpi/acpi_bus.h
+++ linux-pm/include/acpi/acpi_bus.h
@@ -481,6 +481,8 @@ void acpi_initialize_hp_context(struct a
extern struct bus_type acpi_bus_type;
int acpi_bus_for_each_dev(int (*fn)(struct device *, void *), void *data);
+int acpi_dev_for_each_child(struct acpi_device *adev,
+ int (*fn)(struct device *, void *), void *data);
/*
* Events
next prev parent reply other threads:[~2022-04-04 15:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-04 15:20 [PATCH v1 0/3] ACPI: PCI: PM: Power up PCI devices with ACPI companions upfront Rafael J. Wysocki
2022-04-04 15:21 ` Rafael J. Wysocki [this message]
2022-04-04 15:23 ` [PATCH v1 2/3] ACPI: PM: Introduce acpi_dev_power_up_children_with_adr() Rafael J. Wysocki
2022-04-04 15:25 ` [PATCH v1 3/3] PCI: ACPI: PM: Power up devices in D3cold before scanning them Rafael J. Wysocki
2022-04-07 17:51 ` Bjorn Helgaas
2022-04-05 9:46 ` [PATCH v1 0/3] ACPI: PCI: PM: Power up PCI devices with ACPI companions upfront Mika Westerberg
2022-04-05 12:07 ` Rafael J. Wysocki
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=3679769.kQq0lBPeGt@kreacher \
--to=rjw@rjwysocki.net \
--cc=helgaas@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
/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