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

Function rt_pci_device_remove

components/drivers/pci/probe.c:899–931  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

897}
898
899rt_err_t rt_pci_device_remove(struct rt_pci_device *pdev)
900{
901 rt_err_t err = RT_EOK;
902
903 if (pdev)
904 {
905 struct rt_pci_bus *bus = pdev->bus;
906
907 pci_procfs_detach(pdev);
908
909 spin_lock(&bus->lock);
910
911 while (pdev->parent.ref_count > 1)
912 {
913 spin_unlock(&bus->lock);
914
915 rt_thread_yield();
916
917 spin_lock(&bus->lock);
918 }
919 rt_list_remove(&pdev->list);
920
921 spin_unlock(&bus->lock);
922
923 rt_free(pdev);
924 }
925 else
926 {
927 err = -RT_EINVAL;
928 }
929
930 return err;
931}

Callers 2

pci_removeFunction · 0.85
pci_shutdownFunction · 0.85

Calls 6

rt_thread_yieldFunction · 0.85
rt_list_removeFunction · 0.85
rt_freeFunction · 0.85
pci_procfs_detachFunction · 0.70
spin_lockFunction · 0.70
spin_unlockFunction · 0.70

Tested by

no test coverage detected