@@ -34,6 +34,11 @@ struct pci_dev *dev_to_pci(struct device *dev)
return container_of(dev, struct pci_dev, arch.dev);
}
+void arch_pci_init_pdev(struct pci_dev *pdev)
+{
+ pci_to_dev(pdev)->type = DEV_PCI;
+}
+
static int __init dt_pci_init(void)
{
struct dt_device_node *np;
@@ -329,6 +329,8 @@ static struct pci_dev *alloc_pdev(struct pci_seg *pseg, u8 bus, u8 devfn)
*((u8*) &pdev->devfn) = devfn;
pdev->domain = NULL;
+ arch_pci_init_pdev(pdev);
+
rc = pdev_msi_init(pdev);
if ( rc )
{
@@ -105,6 +105,9 @@ static always_inline bool is_pci_passthrough_enabled(void)
{
return pci_passthrough_enabled;
}
+
+void arch_pci_init_pdev(struct pci_dev *pdev);
+
#else /*!CONFIG_HAS_PCI*/
struct arch_pci_dev { };
@@ -121,5 +124,9 @@ static inline int pci_get_host_bridge_segment(const struct dt_device_node *node,
return -EINVAL;
}
+struct pci_dev;
+
+static inline void arch_pci_init_pdev(struct pci_dev *pdev) {}
+
#endif /*!CONFIG_HAS_PCI*/
#endif /* __ARM_PCI_H__ */
@@ -36,4 +36,6 @@ static always_inline bool is_pci_passthrough_enabled(void)
return true;
}
+static inline void arch_pci_init_pdev(struct pci_dev *pdev) {}
+
#endif /* __X86_PCI_H__ */