| 959 | } |
| 960 | |
| 961 | static 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 | |
| 986 | static rt_err_t pci_shutdown(rt_device_t dev) |
| 987 | { |
nothing calls this directly
no test coverage detected