diff mbox series

[v7-incomplete,3/3] PCI: Unify ACPI and DT 'preserve config' support

Message ID 20240421190914.374399-4-helgaas@kernel.org (mailing list archive)
State Not Applicable
Headers show
Series PCI: Add support for preserving boot configuration | expand

Commit Message

Bjorn Helgaas April 21, 2024, 7:09 p.m. UTC
From: Bjorn Helgaas <bhelgaas@google.com>

---
 drivers/pci/probe.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Andy Shevchenko April 22, 2024, 7:43 a.m. UTC | #1
Sun, Apr 21, 2024 at 02:09:14PM -0500, Bjorn Helgaas kirjoitti:

...

> +	if (host_bridge->dev.parent && host_bridge->dev.parent->of_node)
> +		return of_pci_preserve_config(host_bridge->dev.parent->of_node);

If you need fwnode or of_node from struct device, please avoid direct
dereference, we have

dev_fwnode()
of_fwnode_handle()
dev_of_node()
diff mbox series

Patch

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index ee086d029450..2c232c22d6af 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -894,6 +894,9 @@  static bool pci_preserve_config(struct pci_host_bridge *host_bridge)
 	if (pci_acpi_preserve_config(host_bridge))
 		return true;
 
+	if (host_bridge->dev.parent && host_bridge->dev.parent->of_node)
+		return of_pci_preserve_config(host_bridge->dev.parent->of_node);
+
 	return false;
 }