[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210811153619.88922-3-boqun.feng@gmail.com>
Date: Wed, 11 Aug 2021 23:36:16 +0800
From: Boqun Feng <boqun.feng@...il.com>
To: Lorenzo Pieralisi <lorenzo.pieralisi@....com>
Cc: Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Len Brown <lenb@...nel.org>,
"K. Y. Srinivasan" <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>,
Wei Liu <wei.liu@...nel.org>, Dexuan Cui <decui@...rosoft.com>,
Rob Herring <robh@...nel.org>,
Krzysztof WilczyĆski <kw@...ux.com>,
Boqun Feng <boqun.feng@...il.com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-pci@...r.kernel.org, linux-acpi@...r.kernel.org,
linux-hyperv@...r.kernel.org,
Sunil Muthuswamy <sunilmut@...rosoft.com>,
Marc Zyngier <maz@...nel.org>, Arnd Bergmann <arnd@...db.de>
Subject: [RFC 2/5] PCI/ACPI: Store ACPI device information in the host bridge structure
In order to decouple the ACPI device information of a PCI host bridge
from the sysdata, ->private of pci_host_bridge is used to store the ACPI
device, and it's done by the new pci_create_root_bus_priv().
A reader function is also added, to retrieve the ACPI device information
in pci_host_bridge.
Signed-off-by: Boqun Feng <boqun.feng@...il.com>
---
drivers/acpi/pci_root.c | 5 +++--
include/linux/pci-acpi.h | 5 +++++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index d7deedf3548e..82824841cbda 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -894,8 +894,9 @@ struct pci_bus *acpi_pci_root_create(struct acpi_pci_root *root,
pci_acpi_root_add_resources(info);
pci_add_resource(&info->resources, &root->secondary);
- bus = pci_create_root_bus(NULL, busnum, ops->pci_ops,
- sysdata, &info->resources);
+ bus = pci_create_root_bus_priv(NULL, busnum, ops->pci_ops, sysdata,
+ &info->resources, &root->device,
+ sizeof(struct acpi_device *));
if (!bus)
goto out_release_info;
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h
index 5ba475ca9078..21d4cc80aa55 100644
--- a/include/linux/pci-acpi.h
+++ b/include/linux/pci-acpi.h
@@ -80,6 +80,11 @@ extern struct pci_bus *acpi_pci_root_create(struct acpi_pci_root *root,
struct acpi_pci_root_ops *ops,
struct acpi_pci_root_info *info,
void *sd);
+static inline struct acpi_device *
+acpi_pci_root_device(struct pci_host_bridge *bridge)
+{
+ return *((struct acpi_device **)bridge->private);
+}
void acpi_pci_add_bus(struct pci_bus *bus);
void acpi_pci_remove_bus(struct pci_bus *bus);
--
2.32.0
Powered by blists - more mailing lists