MCPcopy Create free account
hub / github.com/OAID/Tengine / UnloadDevice

Method UnloadDevice

executor/lib/device_driver.cpp:130–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130bool DriverManager::UnloadDevice(Driver* driver, Device* device)
131{
132 const dev_id_t& dev_id = device->GetDeviceID();
133 DevExecutor* dev_executor = nullptr;
134
135 DevExecutorManager::SafeGet(dev_id, dev_executor);
136
137 if(dev_executor)
138 {
139 if(!dev_executor->Stop() || !device->Stop())
140 return false;
141
142 DevExecutorManager::UnregisterDevExecutor(dev_executor);
143
144 dev_executor->UnbindDevice();
145 dev_executor->Release();
146
147 delete dev_executor;
148 }
149 else
150 {
151 if(!device->Stop())
152 return false;
153 }
154
155 driver->DestroyDevice(device);
156
157 return true;
158}
159
160bool DriverManager::LoadDevice(Driver* driver)
161{

Callers

nothing calls this directly

Calls 6

StopMethod · 0.45
UnbindDeviceMethod · 0.45
ReleaseMethod · 0.45
DestroyDeviceMethod · 0.45
GetDeviceNumMethod · 0.45
GetDeviceMethod · 0.45

Tested by

no test coverage detected