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