MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / pci_remove

Function pci_remove

components/drivers/pci/pci.c:961–984  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

959}
960
961static rt_err_t pci_remove(rt_device_t dev)
962{
963 rt_err_t err = RT_EOK;
964 struct rt_pci_bus *bus;
965 struct rt_pci_driver *pdrv = rt_container_of(dev->drv, struct rt_pci_driver, parent);
966 struct rt_pci_device *pdev = rt_container_of(dev, struct rt_pci_device, parent);
967
968 if (pdrv && pdrv->remove)
969 {
970 if ((err = pdrv->remove(pdev)))
971 {
972 return err;
973 }
974 }
975
976 rt_pci_enable_wake(pdev, RT_PCI_D0, RT_FALSE);
977
978 bus = pdev->bus;
979 rt_pci_device_remove(pdev);
980 /* Just try to remove */
981 rt_pci_bus_remove(bus);
982
983 return err;
984}
985
986static rt_err_t pci_shutdown(rt_device_t dev)
987{

Callers

nothing calls this directly

Calls 3

rt_pci_enable_wakeFunction · 0.85
rt_pci_device_removeFunction · 0.85
rt_pci_bus_removeFunction · 0.85

Tested by

no test coverage detected