linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 1/1] PCI: of: Propagate firmware node by calling device_set_node()
@ 2023-04-21 10:09 Andy Shevchenko
  2023-06-05 14:13 ` Andy Shevchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2023-04-21 10:09 UTC (permalink / raw)
  To: Rob Herring, Pali Rohár, linux-pci, linux-kernel
  Cc: Bjorn Helgaas, Andy Shevchenko

Insulate pci_set_of_node() and pci_set_bus_of_node() from possible
changes to fwnode_handle implementation by using device_set_node()
instead of open-coding dev->dev.fwnode assignments.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v3: fixed compilation issue
v2: rewritten commit message as suggested (Bjorn), rebased on the latest code

 drivers/pci/of.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/pci/of.c b/drivers/pci/of.c
index 4c2ef2e28fb5..82bff748cd4d 100644
--- a/drivers/pci/of.c
+++ b/drivers/pci/of.c
@@ -39,16 +39,14 @@ int pci_set_of_node(struct pci_dev *dev)
 		return -ENODEV;
 	}
 
-	dev->dev.of_node = node;
-	dev->dev.fwnode = &node->fwnode;
+	device_set_node(&dev->dev, of_fwnode_handle(node));
 	return 0;
 }
 
 void pci_release_of_node(struct pci_dev *dev)
 {
 	of_node_put(dev->dev.of_node);
-	dev->dev.of_node = NULL;
-	dev->dev.fwnode = NULL;
+	device_set_node(&dev->dev, NULL);
 }
 
 void pci_set_bus_of_node(struct pci_bus *bus)
@@ -63,17 +61,13 @@ void pci_set_bus_of_node(struct pci_bus *bus)
 			bus->self->external_facing = true;
 	}
 
-	bus->dev.of_node = node;
-
-	if (bus->dev.of_node)
-		bus->dev.fwnode = &bus->dev.of_node->fwnode;
+	device_set_node(&bus->dev, of_fwnode_handle(node));
 }
 
 void pci_release_bus_of_node(struct pci_bus *bus)
 {
 	of_node_put(bus->dev.of_node);
-	bus->dev.of_node = NULL;
-	bus->dev.fwnode = NULL;
+	device_set_node(&bus->dev, NULL);
 }
 
 struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus)
-- 
2.40.0.1.gaa8946217a0b


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v3 1/1] PCI: of: Propagate firmware node by calling device_set_node()
  2023-04-21 10:09 [PATCH v3 1/1] PCI: of: Propagate firmware node by calling device_set_node() Andy Shevchenko
@ 2023-06-05 14:13 ` Andy Shevchenko
  2023-06-06 22:17   ` Bjorn Helgaas
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2023-06-05 14:13 UTC (permalink / raw)
  To: Rob Herring, Pali Rohár, linux-pci, linux-kernel; +Cc: Bjorn Helgaas

On Fri, Apr 21, 2023 at 01:09:39PM +0300, Andy Shevchenko wrote:
> Insulate pci_set_of_node() and pci_set_bus_of_node() from possible
> changes to fwnode_handle implementation by using device_set_node()
> instead of open-coding dev->dev.fwnode assignments.

Any news on this change? Should I do anything?

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3 1/1] PCI: of: Propagate firmware node by calling device_set_node()
  2023-06-05 14:13 ` Andy Shevchenko
@ 2023-06-06 22:17   ` Bjorn Helgaas
  0 siblings, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2023-06-06 22:17 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Rob Herring, Pali Rohár, linux-pci, linux-kernel, Bjorn Helgaas

On Mon, Jun 05, 2023 at 05:13:26PM +0300, Andy Shevchenko wrote:
> On Fri, Apr 21, 2023 at 01:09:39PM +0300, Andy Shevchenko wrote:
> > Insulate pci_set_of_node() and pci_set_bus_of_node() from possible
> > changes to fwnode_handle implementation by using device_set_node()
> > instead of open-coding dev->dev.fwnode assignments.
> 
> Any news on this change? Should I do anything?

Thanks for the reminder, I applied this to pci/enumeration for v6.5.

Bjorn

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-06 22:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-21 10:09 [PATCH v3 1/1] PCI: of: Propagate firmware node by calling device_set_node() Andy Shevchenko
2023-06-05 14:13 ` Andy Shevchenko
2023-06-06 22:17   ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).