While adding a PCI device mark it as such, so other frameworks
can distinguish it from DT devices.
For that introduce an architecture defined helper which may perform
additional initialization of the newly created PCI device.
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
[applicable parts]
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Rahul Singh <rahul.singh@arm.com>
Tested-by: Rahul Singh <rahul.singh@arm.com>
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;
*((u8*) &pdev->devfn) = devfn;
pdev->domain = NULL;
+ arch_pci_init_pdev(pdev);
+
rc = pdev_msi_init(pdev);
if ( rc )
{
{
return pci_passthrough_enabled;
}
+
+void arch_pci_init_pdev(struct pci_dev *pdev);
+
#else /*!CONFIG_HAS_PCI*/
struct arch_pci_dev { };
return false;
}
+struct pci_dev;
+
+static inline void arch_pci_init_pdev(struct pci_dev *pdev) {}
+
#endif /*!CONFIG_HAS_PCI*/
#endif /* __ARM_PCI_H__ */
return true;
}
+static inline void arch_pci_init_pdev(struct pci_dev *pdev) {}
+
#endif /* __X86_PCI_H__ */