aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/pcie/portdrv_core.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
index a0d51e3f34f4..8b3f8c18032f 100644
--- a/drivers/pci/pcie/portdrv_core.c
+++ b/drivers/pci/pcie/portdrv_core.c
@@ -370,6 +370,14 @@ void pcie_port_device_remove(struct pci_dev *dev)
370 pci_disable_msi(dev); 370 pci_disable_msi(dev);
371} 371}
372 372
373/**
374 * pcie_port_probe_service - probe driver for given PCI Express port service
375 * @dev: PCI Express port service device to probe against
376 *
377 * If PCI Express port service driver is registered with
378 * pcie_port_service_register(), this function will be called by the driver core
379 * whenever match is found between the driver and a port service device.
380 */
373static int pcie_port_probe_service(struct device *dev) 381static int pcie_port_probe_service(struct device *dev)
374{ 382{
375 struct pcie_device *pciedev; 383 struct pcie_device *pciedev;
@@ -393,6 +401,15 @@ static int pcie_port_probe_service(struct device *dev)
393 return status; 401 return status;
394} 402}
395 403
404/**
405 * pcie_port_remove_service - detach driver from given PCI Express port service
406 * @dev: PCI Express port service device to handle
407 *
408 * If PCI Express port service driver is registered with
409 * pcie_port_service_register(), this function will be called by the driver core
410 * when device_unregister() is called for the port service device associated
411 * with the driver.
412 */
396static int pcie_port_remove_service(struct device *dev) 413static int pcie_port_remove_service(struct device *dev)
397{ 414{
398 struct pcie_device *pciedev; 415 struct pcie_device *pciedev;
@@ -412,8 +429,21 @@ static int pcie_port_remove_service(struct device *dev)
412 return 0; 429 return 0;
413} 430}
414 431
432/**
433 * pcie_port_shutdown_service - shut down given PCI Express port service
434 * @dev: PCI Express port service device to handle
435 *
436 * If PCI Express port service driver is registered with
437 * pcie_port_service_register(), this function will be called by the driver core
438 * when device_shutdown() is called for the port service device associated
439 * with the driver.
440 */
415static void pcie_port_shutdown_service(struct device *dev) {} 441static void pcie_port_shutdown_service(struct device *dev) {}
416 442
443/**
444 * pcie_port_service_register - register PCI Express port service driver
445 * @new: PCI Express port service driver to register
446 */
417int pcie_port_service_register(struct pcie_port_service_driver *new) 447int pcie_port_service_register(struct pcie_port_service_driver *new)
418{ 448{
419 new->driver.name = (char *)new->name; 449 new->driver.name = (char *)new->name;
@@ -425,6 +455,10 @@ int pcie_port_service_register(struct pcie_port_service_driver *new)
425 return driver_register(&new->driver); 455 return driver_register(&new->driver);
426} 456}
427 457
458/**
459 * pcie_port_service_unregister - unregister PCI Express port service driver
460 * @drv: PCI Express port service driver to unregister
461 */
428void pcie_port_service_unregister(struct pcie_port_service_driver *drv) 462void pcie_port_service_unregister(struct pcie_port_service_driver *drv)
429{ 463{
430 driver_unregister(&drv->driver); 464 driver_unregister(&drv->driver);