Skip to contentSkip to conversation

PCI/portdrv: Use bus-type functions

PATCH Applied Uwe Kleine-König 4 participants 19 messages Dec 2, 2025 – Jan 13 PCI

lore
Share & tools
lore
#0 lore raw

cover PCI/portdrv: Use bus-type functions

Hello,

with the eventual goal to remore .probe(), .remove() and .shutdown() from struct device_driver convert pcie portdrv to use bus-type callbacks.

The first patch is a fix, but I think it's not relevant as I didn't find a pcie driver without a remove callback. Feel free to drop the Fixes line if you think it's not justified and decide yourself if you want it backported to stable. I have no strong opinion here.

For the complete series there is no intended change in behaviour (apart from the fix in the first patch :-).

Best regards
Uwe

Uwe Kleine-König (6):
PCI/portdrv: Fix potential resource leak
PCI/portdrv: Drop empty shutdown callback
PCI/portdrv: Don't check for the driver's and device's bus PCI/portdrv: Move pcie_port_bus_type to pcie source file PCI/portdrv: Don't check for valid device and driver in bus callbacks PCI/portdrv: Use bus-type functions

 drivers/pci/pci-driver.c   | 28 -------------------
 drivers/pci/pcie/portdrv.c | 55 +++++++++++++++++++-------------------
 2 files changed, 28 insertions(+), 55 deletions(-)

base-commit: 7d0a66e4bb9081d75c82ec4957c50034cb0ea449

Signature · 1 line
2.47.3
#1 lore raw

PATCH 1/6 PCI/portdrv: Fix potential resource leak

pcie_port_probe_service() unconditionally calls get_device() (unless it fails). So drop that reference also unconditionally as it's fine for a pcie driver to not have a remove callback.

Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")

---
This isn't very urgent as I think there is no pcie driver without a remove callback

---
 drivers/pci/pcie/portdrv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/pci/pcie/portdrv.c +3 -3
index d1b68c18444f..f13039378908 100644
@@ -557,10 +557,10 @@ static int pcie_port_remove_service(struct device *dev)
 
 	pciedev = to_pcie_device(dev);
 	driver = to_service_driver(dev->driver);
-	if (driver && driver->remove) {
+	if (driver && driver->remove)
 		driver->remove(pciedev);
-		put_device(dev);
-	}
+
+	put_device(dev);
 	return 0;
 }
 
Signature · 1 line
2.47.3
Reviewed-by on v1 1/6
#2 lore raw

Re: [PATCH 1/6] PCI/portdrv: Fix potential resource leak

Quoted 22 lines · Uwe Kleine-König

pcie_port_probe_service() unconditionally calls get_device() (unless it fails). So drop that reference also unconditionally as it's fine for a pcie driver to not have a remove callback.

Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")

---
This isn't very urgent as I think there is no pcie driver without a remove callback

---
 drivers/pci/pcie/portdrv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/pci/pcie/portdrv.c +0 -0
index d1b68c18444f..f13039378908 100644
@@ -557,10 +557,10 @@ static int pcie_port_remove_service(struct device *dev)
 
 	pciedev = to_pcie_device(dev);
 	driver = to_service_driver(dev->driver);

drivers/pci/pcie/portdrv.c static int pcie_port_remove_service(struct device *dev) · line 566

Quoted 10 lines
drivers/pci/pcie/portdrv.c +3 -3
-	if (driver && driver->remove) {
+	if (driver && driver->remove)
 		driver->remove(pciedev);
-		put_device(dev);
-	}
+
+	put_device(dev);
 	return 0;
 }
 
Signature · 1 line
 i.
Reviewed-by on v1 1/6
#3 lore raw

Re: [PATCH 1/6] PCI/portdrv: Fix potential resource leak

In reply to Uwe Kleine-König
Quoted 9 lines · On Tue, 2 Dec 2025 16:13:49 +0100 Uwe Kleine-König…

pcie_port_probe_service() unconditionally calls get_device() (unless it fails). So drop that reference also unconditionally as it's fine for a pcie driver to not have a remove callback.

Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")

---
This isn't very urgent as I think there is no pcie driver without a remove callback

Quoted 22 lines
---
 drivers/pci/pcie/portdrv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/pci/pcie/portdrv.c +3 -3
index d1b68c18444f..f13039378908 100644
@@ -557,10 +557,10 @@ static int pcie_port_remove_service(struct device *dev)
 
 	pciedev = to_pcie_device(dev);
 	driver = to_service_driver(dev->driver);
-	if (driver && driver->remove) {
+	if (driver && driver->remove)
 		driver->remove(pciedev);
-		put_device(dev);
-	}
+
+	put_device(dev);
 	return 0;
 }
 
#4 lore raw

PATCH 2/6 PCI/portdrv: Drop empty shutdown callback

In reply to Uwe Kleine-König

.shutdown() is an optional callback and the core only calls it if the pointer in struct device_driver is non-NULL. So make nothing in a bit shorter time and remove the empty function.

---
 drivers/pci/pcie/portdrv.c | 12 ------------
 1 file changed, 12 deletions(-)
drivers/pci/pcie/portdrv.c +0 -12
index f13039378908..63492c3d3565 100644
@@ -564,17 +564,6 @@ static int pcie_port_remove_service(struct device *dev)
 	return 0;
 }
 
-/**
- * pcie_port_shutdown_service - shut down given PCI Express port service
- * @dev: PCI Express port service device to handle
- *
- * If PCI Express port service driver is registered with
- * pcie_port_service_register(), this function will be called by the driver core
- * when device_shutdown() is called for the port service device associated
- * with the driver.
- */
-static void pcie_port_shutdown_service(struct device *dev) {}
-
 /**
  * pcie_port_service_register - register PCI Express port service driver
  * @new: PCI Express port service driver to register
@@ -588,7 +577,6 @@ int pcie_port_service_register(struct pcie_port_service_driver *new)
 	new->driver.bus = &pcie_port_bus_type;
 	new->driver.probe = pcie_port_probe_service;
 	new->driver.remove = pcie_port_remove_service;
-	new->driver.shutdown = pcie_port_shutdown_service;
 
 	return driver_register(&new->driver);
 }
Signature · 1 line
2.47.3
#5 lore raw

Re: [PATCH 2/6] PCI/portdrv: Drop empty shutdown callback

Quoted 5 lines · Uwe Kleine-König

.shutdown() is an optional callback and the core only calls it if the pointer in struct device_driver is non-NULL. So make nothing in a bit shorter time and remove the empty function.

I got the email address wrong here. If this version is picked up, can you please make this

to match the author? I'll fix it in my tree to get this right for v2 (if that will happen).

Thanks
Uwe

Reviewed-by on v1 2/6
#6 lore raw

Re: [PATCH 2/6] PCI/portdrv: Drop empty shutdown callback

In reply to Uwe Kleine-König
Quoted 33 lines · Uwe Kleine-König

.shutdown() is an optional callback and the core only calls it if the pointer in struct device_driver is non-NULL. So make nothing in a bit shorter time and remove the empty function.

---
 drivers/pci/pcie/portdrv.c | 12 ------------
 1 file changed, 12 deletions(-)
drivers/pci/pcie/portdrv.c +0 -11
index f13039378908..63492c3d3565 100644
@@ -564,17 +564,6 @@ static int pcie_port_remove_service(struct device *dev)
 	return 0;
 }
 
-/**
- * pcie_port_shutdown_service - shut down given PCI Express port service
- * @dev: PCI Express port service device to handle
- *
- * If PCI Express port service driver is registered with
- * pcie_port_service_register(), this function will be called by the driver core
- * when device_shutdown() is called for the port service device associated
- * with the driver.
- */
-static void pcie_port_shutdown_service(struct device *dev) {}
-
 /**
  * pcie_port_service_register - register PCI Express port service driver
  * @new: PCI Express port service driver to register

drivers/pci/pcie/portdrv.c int pcie_port_service_register(struct pcie_port_service_driver *new) · line 582

Quoted 7 lines
drivers/pci/pcie/portdrv.c +0 -1
@@ -588,7 +577,6 @@ int pcie_port_service_register(struct pcie_port_service_driver *new)
 	new->driver.bus = &pcie_port_bus_type;
 	new->driver.probe = pcie_port_probe_service;
 	new->driver.remove = pcie_port_remove_service;
-	new->driver.shutdown = pcie_port_shutdown_service;
 
 	return driver_register(&new->driver);
 }
Signature · 1 line
 i.
Reviewed-by on v1 2/6
#7 lore raw

Re: [PATCH 2/6] PCI/portdrv: Drop empty shutdown callback

In reply to Uwe Kleine-König
Quoted 5 lines · On Tue, 2 Dec 2025 16:13:50 +0100 Uwe Kleine-König…

.shutdown() is an optional callback and the core only calls it if the pointer in struct device_driver is non-NULL. So make nothing in a bit shorter time and remove the empty function.

#8 lore raw

PATCH 3/6 PCI/portdrv: Don't check for the driver's and device's bus

In reply to Uwe Kleine-König

The driver core ensures that the match function is only called for drivers and devices of the right bus. So drop the useless check.

---
 drivers/pci/pci-driver.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/pci/pci-driver.c +2 -8
index 302d61783f6c..2b6a628fc7d0 100644
@@ -1702,14 +1702,8 @@ EXPORT_SYMBOL(pci_bus_type);
 #ifdef CONFIG_PCIEPORTBUS
 static int pcie_port_bus_match(struct device *dev, const struct device_driver *drv)
 {
-	struct pcie_device *pciedev;
-	const struct pcie_port_service_driver *driver;
-
-	if (drv->bus != &pcie_port_bus_type || dev->bus != &pcie_port_bus_type)
-		return 0;
-
-	pciedev = to_pcie_device(dev);
-	driver = to_service_driver(drv);
+	struct pcie_device *pciedev = to_pcie_device(dev);
+	const struct pcie_port_service_driver *driver = to_service_driver(drv);
 
 	if (driver->service != pciedev->service)
 		return 0;
Signature · 1 line
2.47.3
Reviewed-by on v1 3/6
#9 lore raw

Re: [PATCH 3/6] PCI/portdrv: Don't check for the driver's and device's bus

Quoted 4 lines · On Tue, 2 Dec 2025 16:13:51 +0100 Uwe Kleine-König…

The driver core ensures that the match function is only called for drivers and devices of the right bus. So drop the useless check.

A lot of stuff would be broken if match functions were called on wrong types of devices :(

#10 lore raw

PATCH 4/6 PCI/portdrv: Move pcie_port_bus_type to pcie source file

In reply to Uwe Kleine-König

Conceptually the pci_express bus doesn't belong in generic pci code.

---
 drivers/pci/pci-driver.c   | 22 ----------------------
 drivers/pci/pcie/portdrv.c | 20 ++++++++++++++++++++
 2 files changed, 20 insertions(+), 22 deletions(-)
drivers/pci/pci-driver.c +0 -22
index 2b6a628fc7d0..addb1d226a25 100644
@@ -1699,28 +1699,6 @@ const struct bus_type pci_bus_type = {
 };
 EXPORT_SYMBOL(pci_bus_type);
 
-#ifdef CONFIG_PCIEPORTBUS
-static int pcie_port_bus_match(struct device *dev, const struct device_driver *drv)
-{
-	struct pcie_device *pciedev = to_pcie_device(dev);
-	const struct pcie_port_service_driver *driver = to_service_driver(drv);
-
-	if (driver->service != pciedev->service)
-		return 0;
-
-	if (driver->port_type != PCIE_ANY_PORT &&
-	    driver->port_type != pci_pcie_type(pciedev->port))
-		return 0;
-
-	return 1;
-}
-
-const struct bus_type pcie_port_bus_type = {
-	.name		= "pci_express",
-	.match		= pcie_port_bus_match,
-};
-#endif
-
 static int __init pci_driver_init(void)
 {
 	int ret;
drivers/pci/pcie/portdrv.c +20 -0
index 63492c3d3565..5cb0daf6781b 100644
@@ -508,6 +508,21 @@ static void pcie_port_device_remove(struct pci_dev *dev)
 	pci_free_irq_vectors(dev);
 }
 
+static int pcie_port_bus_match(struct device *dev, const struct device_driver *drv)
+{
+	struct pcie_device *pciedev = to_pcie_device(dev);
+	const struct pcie_port_service_driver *driver = to_service_driver(drv);
+
+	if (driver->service != pciedev->service)
+		return 0;
+
+	if (driver->port_type != PCIE_ANY_PORT &&
+	    driver->port_type != pci_pcie_type(pciedev->port))
+		return 0;
+
+	return 1;
+}
+
 /**
  * pcie_port_probe_service - probe driver for given PCI Express port service
  * @dev: PCI Express port service device to probe against
@@ -564,6 +579,11 @@ static int pcie_port_remove_service(struct device *dev)
 	return 0;
 }
 
+const struct bus_type pcie_port_bus_type = {
+	.name = "pci_express",
+	.match = pcie_port_bus_match,
+};
+
 /**
  * pcie_port_service_register - register PCI Express port service driver
  * @new: PCI Express port service driver to register
Signature · 1 line
2.47.3
#11 lore raw

Re: [PATCH 4/6] PCI/portdrv: Move pcie_port_bus_type to pcie source file

Quoted 69 lines · Uwe Kleine-König

Conceptually the pci_express bus doesn't belong in generic pci code.

---
 drivers/pci/pci-driver.c   | 22 ----------------------
 drivers/pci/pcie/portdrv.c | 20 ++++++++++++++++++++
 2 files changed, 20 insertions(+), 22 deletions(-)
drivers/pci/pci-driver.c +0 -22
index 2b6a628fc7d0..addb1d226a25 100644
@@ -1699,28 +1699,6 @@ const struct bus_type pci_bus_type = {
 };
 EXPORT_SYMBOL(pci_bus_type);
 
-#ifdef CONFIG_PCIEPORTBUS
-static int pcie_port_bus_match(struct device *dev, const struct device_driver *drv)
-{
-	struct pcie_device *pciedev = to_pcie_device(dev);
-	const struct pcie_port_service_driver *driver = to_service_driver(drv);
-
-	if (driver->service != pciedev->service)
-		return 0;
-
-	if (driver->port_type != PCIE_ANY_PORT &&
-	    driver->port_type != pci_pcie_type(pciedev->port))
-		return 0;
-
-	return 1;
-}
-
-const struct bus_type pcie_port_bus_type = {
-	.name		= "pci_express",
-	.match		= pcie_port_bus_match,
-};
-#endif
-
 static int __init pci_driver_init(void)
 {
 	int ret;
drivers/pci/pcie/portdrv.c +15 -0
index 63492c3d3565..5cb0daf6781b 100644
@@ -508,6 +508,21 @@ static void pcie_port_device_remove(struct pci_dev *dev)
 	pci_free_irq_vectors(dev);
 }
 
+static int pcie_port_bus_match(struct device *dev, const struct device_driver *drv)
+{
+	struct pcie_device *pciedev = to_pcie_device(dev);
+	const struct pcie_port_service_driver *driver = to_service_driver(drv);
+
+	if (driver->service != pciedev->service)
+		return 0;
+
+	if (driver->port_type != PCIE_ANY_PORT &&
+	    driver->port_type != pci_pcie_type(pciedev->port))
+		return 0;
+
+	return 1;
+}
+
 /**
  * pcie_port_probe_service - probe driver for given PCI Express port service
  * @dev: PCI Express port service device to probe against
@@ -564,6 +579,11 @@ static int pcie_port_remove_service(struct device *dev)
 	return 0;

drivers/pci/pcie/portdrv.c static int pcie_port_remove_service(struct device *dev) · line 589

Quoted 10 lines
drivers/pci/pcie/portdrv.c +5 -0
 }
 
+const struct bus_type pcie_port_bus_type = {
+	.name = "pci_express",
+	.match = pcie_port_bus_match,
+};
+
 /**
  * pcie_port_service_register - register PCI Express port service driver
  * @new: PCI Express port service driver to register

I wonder if you should also relocate that #ifdef region bus_register(&pcie_port_bus_type); is in and make pcie_port_bus_type static? As is, this move feels somewhat incomplete.

Signature · 1 line
 i.
#12 lore raw

Re: [PATCH 4/6] PCI/portdrv: Move pcie_port_bus_type to pcie source file

Hello Ilpo,

Quoted 5 lines · Ilpo Järvinen
Quoted 4 lines · Uwe Kleine-König
drivers/pci/pcie/portdrv.c +0 -0
@@ -564,6 +579,11 @@ static int pcie_port_remove_service(struct device *dev)
 	return 0;
 }
 
Quoted 12 lines

drivers/pci/pcie/portdrv.c static int pcie_port_remove_service(struct device *dev) · line 589

Quoted 8 lines
drivers/pci/pcie/portdrv.c +5 -0
+const struct bus_type pcie_port_bus_type = {
+	.name = "pci_express",
+	.match = pcie_port_bus_match,
+};
+
 /**
  * pcie_port_service_register - register PCI Express port service driver
  * @new: PCI Express port service driver to register

I wonder if you should also relocate that #ifdef region bus_register(&pcie_port_bus_type); is in and make pcie_port_bus_type static? As is, this move feels somewhat incomplete.

Yeah, I agree, I had the same feeling. I decided against that because I'd need a new function that just calls bus_register and that has to be called from pci_driver_init(). I thought this to be hardly better than the status quo. Looking again pcieportdrv.o is a separate module that doesn't have an initcall, so this could be done in there. Will have a look early next week.

Best regards
Uwe

#13 lore raw

Re: [PATCH 4/6] PCI/portdrv: Move pcie_port_bus_type to pcie source file

Quoted 21 lines · Uwe Kleine-König

Hello Ilpo,

Quoted 5 lines · Ilpo Järvinen
Quoted 4 lines · Uwe Kleine-König
(quoted diff) +0 -0
@@ -564,6 +579,11 @@ static int pcie_port_remove_service(struct device *dev)
 	return 0;
 }
 
Quoted 12 lines

Review static int pcie_port_remove_service(struct device *dev) · line 589

Quoted 8 lines
(quoted diff) +5 -0
+const struct bus_type pcie_port_bus_type = {
+	.name = "pci_express",
+	.match = pcie_port_bus_match,
+};
+
 /**
  * pcie_port_service_register - register PCI Express port service driver
  * @new: PCI Express port service driver to register

I wonder if you should also relocate that #ifdef region bus_register(&pcie_port_bus_type); is in and make pcie_port_bus_type static? As is, this move feels somewhat incomplete.

Quoted 6 lines

Yeah, I agree, I had the same feeling. I decided against that because I'd need a new function that just calls bus_register and that has to be called from pci_driver_init(). I thought this to be hardly better than the status quo. Looking again pcieportdrv.o is a separate module that doesn't have an initcall, so this could be done in there. Will have a look early next week.

This is wrong for two reasons. a) there is an initcall in drivers/pci/pcie/portdrv.c, and b) it took me longer than "next week".

So the move could be completed by:

drivers/pci/pci-driver.c +0 -5
index 2cc4e9e6f5ef..23316b5f1491 100644
@@ -1709,11 +1709,6 @@ static int __init pci_driver_init(void)
 	if (ret)
 		return ret;
 
-#ifdef CONFIG_PCIEPORTBUS
-	ret = bus_register(&pcie_port_bus_type);
-	if (ret)
-		return ret;
-#endif
 	dma_debug_add_bus(&pci_bus_type);
 	return 0;
 }
drivers/pci/pcie/portdrv.c +6 -0
index 88af0dacf351..3382d50ecb3e 100644
@@ -838,9 +838,15 @@ static void __init pcie_init_services(void)
 
 static int __init pcie_portdrv_init(void)
 {
+	int ret;
+
 	if (pcie_ports_disabled)
 		return -EACCES;
 
+	ret = bus_register(&pcie_port_bus_type);
+	if (ret)
+		return ret;
+
 	pcie_init_services();
 	dmi_check_system(pcie_portdrv_dmi_table);
 

But I'd like to have this postponed and in a separate patch because pci_driver_init() is a postcore_initcall and pcie_portdrv_init is only a normal device_initcall(). So it definitively changes ordering and I'd fear regressions. It would be sad if patches #5 and #6 would need to be reverted to fix a regression in this area.

So given this is the only open issue in this series I'm aware of, can we please get this in? Then I'll send a patch for the above change during the next development cycle.

Best regards
Uwe

#14 lore raw

PATCH 5/6 PCI/portdrv: Don't check for valid device and driver in bus callbacks

In reply to Uwe Kleine-König

The driver core ensures that in .probe() and .remove() both dev and dev->driver are valid. So drop the respective check.

---
 drivers/pci/pcie/portdrv.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/pci/pcie/portdrv.c +0 -6
index 5cb0daf6781b..f164fbd0884c 100644
@@ -537,9 +537,6 @@ static int pcie_port_probe_service(struct device *dev)
 	struct pcie_port_service_driver *driver;
 	int status;
 
-	if (!dev || !dev->driver)
-		return -ENODEV;
-
 	driver = to_service_driver(dev->driver);
 	if (!driver || !driver->probe)
 		return -ENODEV;
@@ -567,9 +564,6 @@ static int pcie_port_remove_service(struct device *dev)
 	struct pcie_device *pciedev;
 	struct pcie_port_service_driver *driver;
 
-	if (!dev || !dev->driver)
-		return 0;
-
 	pciedev = to_pcie_device(dev);
 	driver = to_service_driver(dev->driver);
 	if (driver && driver->remove)
Signature · 1 line
2.47.3
#16 lore raw

PATCH 6/6 PCI/portdrv: Use bus-type functions

In reply to Uwe Kleine-König

Instead of assigning the probe function for each driver individually, use .probe and .remove from the pci_express bus. Rename the functions for consistency.

---
 drivers/pci/pcie/portdrv.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/pci/pcie/portdrv.c +6 -7
index f164fbd0884c..87149075bc5a 100644
@@ -524,14 +524,14 @@ static int pcie_port_bus_match(struct device *dev, const struct device_driver *d
 }
 
 /**
- * pcie_port_probe_service - probe driver for given PCI Express port service
+ * pcie_port_bus_probe - probe driver for given PCI Express port service
  * @dev: PCI Express port service device to probe against
  *
  * If PCI Express port service driver is registered with
  * pcie_port_service_register(), this function will be called by the driver core
  * whenever match is found between the driver and a port service device.
  */
-static int pcie_port_probe_service(struct device *dev)
+static int pcie_port_bus_probe(struct device *dev)
 {
 	struct pcie_device *pciedev;
 	struct pcie_port_service_driver *driver;
@@ -551,7 +551,7 @@ static int pcie_port_probe_service(struct device *dev)
 }
 
 /**
- * pcie_port_remove_service - detach driver from given PCI Express port service
+ * pcie_port_bus_remove - detach driver from given PCI Express port service
  * @dev: PCI Express port service device to handle
  *
  * If PCI Express port service driver is registered with
@@ -559,7 +559,7 @@ static int pcie_port_probe_service(struct device *dev)
  * when device_unregister() is called for the port service device associated
  * with the driver.
  */
-static int pcie_port_remove_service(struct device *dev)
+static void pcie_port_bus_remove(struct device *dev)
 {
 	struct pcie_device *pciedev;
 	struct pcie_port_service_driver *driver;
@@ -570,12 +570,13 @@ static int pcie_port_remove_service(struct device *dev)
 		driver->remove(pciedev);
 
 	put_device(dev);
-	return 0;
 }
 
 const struct bus_type pcie_port_bus_type = {
 	.name = "pci_express",
 	.match = pcie_port_bus_match,
+	.probe = pcie_port_bus_probe,
+	.remove = pcie_port_bus_remove,
 };
 
 /**
@@ -589,8 +590,6 @@ int pcie_port_service_register(struct pcie_port_service_driver *new)
 
 	new->driver.name = new->name;
 	new->driver.bus = &pcie_port_bus_type;
-	new->driver.probe = pcie_port_probe_service;
-	new->driver.remove = pcie_port_remove_service;
 
 	return driver_register(&new->driver);
 }
Signature · 1 line
2.47.3
#18 lore raw
In reply to Uwe Kleine-König
Quoted 25 lines · Uwe Kleine-König

Hello,

with the eventual goal to remore .probe(), .remove() and .shutdown() from struct device_driver convert pcie portdrv to use bus-type callbacks.

The first patch is a fix, but I think it's not relevant as I didn't find a pcie driver without a remove callback. Feel free to drop the Fixes line if you think it's not justified and decide yourself if you want it backported to stable. I have no strong opinion here.

For the complete series there is no intended change in behaviour (apart from the fix in the first patch :-).

Best regards
Uwe

Uwe Kleine-König (6):
PCI/portdrv: Fix potential resource leak
PCI/portdrv: Drop empty shutdown callback
PCI/portdrv: Don't check for the driver's and device's bus PCI/portdrv: Move pcie_port_bus_type to pcie source file PCI/portdrv: Don't check for valid device and driver in bus callbacks PCI/portdrv: Use bus-type functions

Quoted 3 lines
 drivers/pci/pci-driver.c   | 28 -------------------
 drivers/pci/pcie/portdrv.c | 55 +++++++++++++++++++-------------------
 2 files changed, 28 insertions(+), 55 deletions(-)

Applied to pci/portdrv for v6.20, thanks for doing this!