Changes in uspace/lib/usbhost/src/endpoint.c [563d9d0a:aa81adc] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/endpoint.c
r563d9d0a raa81adc 53 53 instance->toggle = 0; 54 54 instance->active = false; 55 instance->destroy_hook = NULL;56 instance->hc_data.data = NULL;57 instance->hc_data.toggle_get = NULL;58 instance->hc_data.toggle_set = NULL;59 55 fibril_mutex_initialize(&instance->guard); 60 56 fibril_condvar_initialize(&instance->avail); … … 68 64 assert(instance); 69 65 assert(!instance->active); 70 if (instance->hc_data.data) {71 assert(instance->destroy_hook);72 instance->destroy_hook(instance);73 }74 66 free(instance); 75 67 } 76 68 /*----------------------------------------------------------------------------*/ 77 69 void endpoint_set_hc_data(endpoint_t *instance, 78 void *data, void (*destroy_hook)(endpoint_t *), 79 int (*toggle_get)(void *), void (*toggle_set)(void *, int)) 70 void *data, int (*toggle_get)(void *), void (*toggle_set)(void *, int)) 80 71 { 81 72 assert(instance); 82 instance->destroy_hook = destroy_hook;83 73 instance->hc_data.data = data; 84 74 instance->hc_data.toggle_get = toggle_get; … … 89 79 { 90 80 assert(instance); 91 instance->destroy_hook = NULL;92 81 instance->hc_data.data = NULL; 93 82 instance->hc_data.toggle_get = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.