Changeset 620c710 in mainline for uspace/lib/usbhost/src/endpoint.c


Ignore:
Timestamp:
2011-08-25T14:21:57Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
961c29e8
Parents:
e20eaed
Message:

libushost: promote endpoint data dtor to destruction hook

ohci: use new usb c driver architecture

File:
1 edited

Legend:

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

    re20eaed r620c710  
    5353                instance->toggle = 0;
    5454                instance->active = false;
     55                instance->destroy_hook = NULL;
    5556                instance->hc_data.data = NULL;
    56                 instance->hc_data.data_dtor = NULL;
    5757                instance->hc_data.toggle_get = NULL;
    5858                instance->hc_data.toggle_set = NULL;
     
    6969        assert(!instance->active);
    7070        if (instance->hc_data.data) {
    71                 assert(instance->hc_data.data_dtor);
    72                 instance->hc_data.data_dtor(instance->hc_data.data);
     71                assert(instance->destroy_hook);
     72                instance->destroy_hook(instance);
    7373        }
    7474        free(instance);
     
    7676/*----------------------------------------------------------------------------*/
    7777void endpoint_set_hc_data(endpoint_t *instance,
    78     void *data, void (*data_dtor)(void *),
     78    void *data, void (*destroy_hook)(endpoint_t *),
    7979    int (*toggle_get)(void *), void (*toggle_set)(void *, int))
    8080{
    8181        assert(instance);
     82        instance->destroy_hook = destroy_hook;
    8283        instance->hc_data.data = data;
    83         instance->hc_data.data_dtor = data_dtor;
    8484        instance->hc_data.toggle_get = toggle_get;
    8585        instance->hc_data.toggle_set = toggle_set;
Note: See TracChangeset for help on using the changeset viewer.