]> xenbits.xensource.com Git - people/tklengyel/xen.git/commitdiff
xen/arm: pci: modify pci_find_host_bridge_node argument to const pdev
authorRahul Singh <rahul.singh@arm.com>
Fri, 9 Sep 2022 09:34:39 +0000 (10:34 +0100)
committerStefano Stabellini <stefano.stabellini@amd.com>
Fri, 9 Sep 2022 20:48:13 +0000 (13:48 -0700)
Modify pci_find_host_bridge_node argument to const pdev to avoid
converting the dev to pdev in pci_find_host_bridge_node and also
constify the return.

Signed-off-by: Rahul Singh <rahul.singh@arm.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
xen/arch/arm/include/asm/pci.h
xen/arch/arm/pci/pci-host-common.c

index 7c7449d64fca362b0af6d589552cd8669d8ba91b..80a24318043581365c5a050cf3fa992d1355397a 100644 (file)
@@ -106,7 +106,8 @@ bool pci_ecam_need_p2m_hwdom_mapping(struct domain *d,
                                      struct pci_host_bridge *bridge,
                                      uint64_t addr);
 struct pci_host_bridge *pci_find_host_bridge(uint16_t segment, uint8_t bus);
-struct dt_device_node *pci_find_host_bridge_node(struct device *dev);
+const struct dt_device_node *
+pci_find_host_bridge_node(const struct pci_dev *pdev);
 int pci_get_host_bridge_segment(const struct dt_device_node *node,
                                 uint16_t *segment);
 
index fd8c0f837a6a4a09cd510a89a5815e5bc278733f..89ef30028e298a99086b021329c5aa55af2fbe45 100644 (file)
@@ -243,10 +243,10 @@ err_exit:
 /*
  * Get host bridge node given a device attached to it.
  */
-struct dt_device_node *pci_find_host_bridge_node(struct device *dev)
+const struct dt_device_node *
+pci_find_host_bridge_node(const struct pci_dev *pdev)
 {
     struct pci_host_bridge *bridge;
-    struct pci_dev *pdev = dev_to_pci(dev);
 
     bridge = pci_find_host_bridge(pdev->seg, pdev->bus);
     if ( unlikely(!bridge) )