@@ -79,7 +79,6 @@ void pcie_port_service_unregister(struct pcie_port_service_driver *new);
#define get_descriptor_id(type, service) (((type - 4) << 8) | service)
extern struct bus_type pcie_port_bus_type;
-void pcie_port_device_remove(struct pci_dev *dev);
int __must_check pcie_port_bus_register(void);
void pcie_port_bus_unregister(void);
@@ -25,13 +25,6 @@ struct portdrv_service_data {
u32 service;
};
-static int remove_iter(struct device *dev, void *data)
-{
- if (dev->bus == &pcie_port_bus_type)
- device_unregister(dev);
- return 0;
-}
-
static int find_service_iter(struct device *device, void *data)
{
struct pcie_port_service_driver *service_driver;
@@ -95,20 +88,6 @@ struct device *pcie_port_find_device(struct pci_dev *dev,
return device;
}
-/**
- * pcie_port_device_remove - unregister PCI Express port service devices
- * @dev: PCI Express port the service devices to unregister are associated with
- *
- * Remove PCI Express port service devices associated with given port and
- * disable MSI-X or MSI for the port.
- */
-void pcie_port_device_remove(struct pci_dev *dev)
-{
- device_for_each_child(&dev->dev, NULL, remove_iter);
- pci_free_irq_vectors(dev);
- pci_disable_device(dev);
-}
-
/**
* pcie_port_probe_service - probe driver for given PCI Express port service
* @dev: PCI Express port service device to probe against
@@ -506,6 +506,27 @@ static int pcie_portdrv_probe(struct pci_dev *dev,
return 0;
}
+static int remove_iter(struct device *dev, void *data)
+{
+ if (dev->bus == &pcie_port_bus_type)
+ device_unregister(dev);
+ return 0;
+}
+
+/**
+ * pcie_port_device_remove - unregister PCI Express port service devices
+ * @dev: PCI Express port the service devices to unregister are associated with
+ *
+ * Remove PCI Express port service devices associated with given port and
+ * disable MSI-X or MSI for the port.
+ */
+static void pcie_port_device_remove(struct pci_dev *dev)
+{
+ device_for_each_child(&dev->dev, NULL, remove_iter);
+ pci_free_irq_vectors(dev);
+ pci_disable_device(dev);
+}
+
static void pcie_portdrv_remove(struct pci_dev *dev)
{
if (pci_bridge_d3_possible(dev)) {