Changeset 432a269 in mainline for uspace/lib/usbhost/src/endpoint.c


Ignore:
Timestamp:
2011-09-16T21:13:57Z (13 years ago)
Author:
Martin Sucha <sucha14@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3a11f17
Parents:
c0e53ff (diff), fd07e526 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/src/endpoint.c

    rc0e53ff r432a269  
    5353                instance->toggle = 0;
    5454                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;
    5559                fibril_mutex_initialize(&instance->guard);
    5660                fibril_condvar_initialize(&instance->avail);
     
    6468        assert(instance);
    6569        assert(!instance->active);
     70        if (instance->hc_data.data) {
     71                assert(instance->destroy_hook);
     72                instance->destroy_hook(instance);
     73        }
    6674        free(instance);
    6775}
    6876/*----------------------------------------------------------------------------*/
    6977void 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))
    7180{
    7281        assert(instance);
     82        instance->destroy_hook = destroy_hook;
    7383        instance->hc_data.data = data;
    7484        instance->hc_data.toggle_get = toggle_get;
     
    7989{
    8090        assert(instance);
     91        instance->destroy_hook = NULL;
    8192        instance->hc_data.data = NULL;
    8293        instance->hc_data.toggle_get = NULL;
Note: See TracChangeset for help on using the changeset viewer.