aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/of.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-07-17 14:26:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-17 14:26:09 -0400
commit3a1d5384b7decbff6519daa9c65a35665e227323 (patch)
tree7442f1b74d452d82d6702f8cd25173cc81c0c634 /drivers/pci/of.c
parent37d4607ebbbf5d8b74cbcb9434a5ce6897a51864 (diff)
parent5e663f0410fa2f355042209154029842ba1abd43 (diff)
Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
Pull virtio, vhost updates from Michael Tsirkin: "Fixes, features, performance: - new iommu device - vhost guest memory access using vmap (just meta-data for now) - minor fixes" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: virtio-mmio: add error check for platform_get_irq scsi: virtio_scsi: Use struct_size() helper iommu/virtio: Add event queue iommu/virtio: Add probe request iommu: Add virtio-iommu driver PCI: OF: Initialize dev->fwnode appropriately of: Allow the iommu-map property to omit untranslated devices dt-bindings: virtio: Add virtio-pci-iommu node dt-bindings: virtio-mmio: Add IOMMU description vhost: fix clang build warning vhost: access vq metadata through kernel virtual address vhost: factor out setting vring addr and num vhost: introduce helpers to get the size of metadata area vhost: rename vq_iotlb_prefetch() to vq_meta_prefetch() vhost: fine grain userspace memory accessors vhost: generalize adding used elem
Diffstat (limited to 'drivers/pci/of.c')
-rw-r--r--drivers/pci/of.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/pci/of.c b/drivers/pci/of.c
index 73d5adec0a28..bc7b27a28795 100644
--- a/drivers/pci/of.c
+++ b/drivers/pci/of.c
@@ -22,12 +22,15 @@ void pci_set_of_node(struct pci_dev *dev)
22 return; 22 return;
23 dev->dev.of_node = of_pci_find_child_device(dev->bus->dev.of_node, 23 dev->dev.of_node = of_pci_find_child_device(dev->bus->dev.of_node,
24 dev->devfn); 24 dev->devfn);
25 if (dev->dev.of_node)
26 dev->dev.fwnode = &dev->dev.of_node->fwnode;
25} 27}
26 28
27void pci_release_of_node(struct pci_dev *dev) 29void pci_release_of_node(struct pci_dev *dev)
28{ 30{
29 of_node_put(dev->dev.of_node); 31 of_node_put(dev->dev.of_node);
30 dev->dev.of_node = NULL; 32 dev->dev.of_node = NULL;
33 dev->dev.fwnode = NULL;
31} 34}
32 35
33void pci_set_bus_of_node(struct pci_bus *bus) 36void pci_set_bus_of_node(struct pci_bus *bus)
@@ -41,13 +44,18 @@ void pci_set_bus_of_node(struct pci_bus *bus)
41 if (node && of_property_read_bool(node, "external-facing")) 44 if (node && of_property_read_bool(node, "external-facing"))
42 bus->self->untrusted = true; 45 bus->self->untrusted = true;
43 } 46 }
47
44 bus->dev.of_node = node; 48 bus->dev.of_node = node;
49
50 if (bus->dev.of_node)
51 bus->dev.fwnode = &bus->dev.of_node->fwnode;
45} 52}
46 53
47void pci_release_bus_of_node(struct pci_bus *bus) 54void pci_release_bus_of_node(struct pci_bus *bus)
48{ 55{
49 of_node_put(bus->dev.of_node); 56 of_node_put(bus->dev.of_node);
50 bus->dev.of_node = NULL; 57 bus->dev.of_node = NULL;
58 bus->dev.fwnode = NULL;
51} 59}
52 60
53struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus) 61struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus)