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

Function driver_bind

TactilityKernel/source/driver.cpp:125–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125error_t driver_bind(Driver* driver, Device* device) {
126 error_t error = ERROR_NONE;
127 if (driver->internal->destroying || !device_is_added(device)) {
128 error = ERROR_INVALID_STATE;
129 goto error;
130 }
131
132 if (driver->start_device != nullptr) {
133 error = driver->start_device(device);
134 if (error != ERROR_NONE) {
135 goto error;
136 }
137 }
138
139 driver->internal->use_count++;
140
141 LOG_I(TAG, "bound %s to %s", driver->name, device->name);
142 return ERROR_NONE;
143
144error:
145 return error;
146}
147
148error_t driver_unbind(Driver* driver, Device* device) {
149 error_t error = ERROR_NONE;

Callers 2

device_startFunction · 0.85

Calls 1

device_is_addedFunction · 0.85

Tested by

no test coverage detected