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

Function driver_unbind

TactilityKernel/source/driver.cpp:148–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148error_t driver_unbind(Driver* driver, Device* device) {
149 error_t error = ERROR_NONE;
150 if (driver->internal->destroying || !device_is_added(device)) {
151 error = ERROR_INVALID_STATE;
152 goto error;
153 }
154
155 if (driver->stop_device != nullptr) {
156 error = driver->stop_device(device);
157 if (error != ERROR_NONE) {
158 goto error;
159 }
160 }
161
162 driver->internal->use_count--;
163
164 LOG_I(TAG, "unbound %s from %s", driver->name, device->name);
165
166 return ERROR_NONE;
167
168error:
169 return error;
170}
171
172const struct DeviceType* driver_get_device_type(struct Driver* driver) {
173 return driver->device_type;

Callers 2

device_stopFunction · 0.85

Calls 1

device_is_addedFunction · 0.85

Tested by

no test coverage detected