MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / device_stop

Function device_stop

TactilityKernel/source/device.cpp:190–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190error_t device_stop(struct Device* device) {
191 LOG_I(TAG, "stop %s", device->name);
192 if (!device->internal->state.added) {
193 return ERROR_INVALID_STATE;
194 }
195
196 if (!device->internal->state.started) {
197 return ERROR_NONE;
198 }
199
200 if (driver_unbind(device->internal->driver, device) != ERROR_NONE) {
201 return ERROR_RESOURCE;
202 }
203
204 device->internal->state.started = false;
205 device->internal->state.start_result = 0;
206 return ERROR_NONE;
207}
208
209error_t device_construct_add(struct Device* device, const char* compatible) {
210 struct Driver* driver = driver_find_compatible(compatible);

Callers 5

DeviceTest.cppFile · 0.85
stop_childFunction · 0.85
destroy_child_deviceFunction · 0.85
stopFunction · 0.85

Calls 1

driver_unbindFunction · 0.85

Tested by

no test coverage detected