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

Function device_construct_add_start

TactilityKernel/source/device.cpp:238–257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236}
237
238error_t device_construct_add_start(struct Device* device, const char* compatible) {
239 error_t error = device_construct_add(device, compatible);
240 if (error != ERROR_NONE) {
241 goto on_construct_add_error;
242 }
243
244 error = device_start(device);
245 if (error != ERROR_NONE) {
246 LOG_E(TAG, "Failed to start device %s: %s", device->name, error_to_string(error));
247 goto on_start_error;
248 }
249
250 return ERROR_NONE;
251
252on_start_error:
253 device_remove(device);
254 device_destruct(device);
255on_construct_add_error:
256 return error;
257}
258
259void device_set_parent(Device* device, Device* parent) {
260 assert(!device->internal->state.started);

Callers 2

start_childFunction · 0.85
kernel_initFunction · 0.85

Calls 5

device_construct_addFunction · 0.85
device_startFunction · 0.85
error_to_stringFunction · 0.85
device_removeFunction · 0.85
device_destructFunction · 0.85

Tested by

no test coverage detected