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

Function rt_pci_bus_remove

components/drivers/pci/probe.c:862–897  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

860}
861
862rt_err_t rt_pci_bus_remove(struct rt_pci_bus *bus)
863{
864 rt_err_t err = RT_EOK;
865
866 if (bus)
867 {
868 spin_lock(&bus->lock);
869
870 if (rt_list_isempty(&bus->children_nodes) &&
871 rt_list_isempty(&bus->devices_nodes))
872 {
873 rt_list_remove(&bus->list);
874 spin_unlock(&bus->lock);
875
876 if (bus->ops->remove)
877 {
878 bus->ops->remove(bus);
879 }
880
881 rt_pci_ofw_bus_free(bus);
882 rt_free(bus);
883 }
884 else
885 {
886 spin_unlock(&bus->lock);
887
888 err = -RT_EBUSY;
889 }
890 }
891 else
892 {
893 err = -RT_EINVAL;
894 }
895
896 return err;
897}
898
899rt_err_t rt_pci_device_remove(struct rt_pci_device *pdev)
900{

Callers 2

pci_removeFunction · 0.85
pci_shutdownFunction · 0.85

Calls 6

rt_list_isemptyFunction · 0.85
rt_list_removeFunction · 0.85
rt_freeFunction · 0.85
spin_lockFunction · 0.70
spin_unlockFunction · 0.70
rt_pci_ofw_bus_freeFunction · 0.70

Tested by

no test coverage detected