Changeset c5b6db53 in mainline


Ignore:
Timestamp:
2011-10-14T15:22:12Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f2964e45
Parents:
af8c9b54
Message:

usbhid: unbind generic hid DDF function.

Location:
uspace/drv/bus/usb/usbhid
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbhid/generic/hiddev.c

    raf8c9b54 rc5b6db53  
    190190/*----------------------------------------------------------------------------*/
    191191
    192 static int usb_generic_hid_create_function(usb_hid_dev_t *hid_dev)
    193 {       
     192void usb_generic_hid_deinit(usb_hid_dev_t *hid_dev, void *data)
     193{
     194        ddf_fun_t *fun = data;
     195        const int ret = ddf_fun_unbind(fun);
     196        if (ret != EOK) {
     197                usb_log_error("ailed to unbind generic hid fun.\n");
     198                return;
     199        }
     200        ddf_fun_destroy(fun);
     201}
     202
     203/*----------------------------------------------------------------------------*/
     204
     205int usb_generic_hid_init(usb_hid_dev_t *hid_dev, void **data)
     206{
     207        if (hid_dev == NULL) {
     208                return EINVAL;
     209        }
     210
    194211        /* Create the exposed function. */
    195212        /** @todo Generate numbers for the devices? */
     
    214231
    215232        usb_log_debug("HID function created. Handle: %" PRIun "\n", fun->handle);
    216 
    217         return EOK;
    218 }
    219 
    220 /*----------------------------------------------------------------------------*/
    221 
    222 int usb_generic_hid_init(usb_hid_dev_t *hid_dev, void **data)
    223 {
    224         if (hid_dev == NULL) {
    225                 return EINVAL;
    226         }
    227 
    228         return usb_generic_hid_create_function(hid_dev);
     233        *data = fun;
     234
     235        return EOK;
    229236}
    230237
  • uspace/drv/bus/usb/usbhid/generic/hiddev.h

    raf8c9b54 rc5b6db53  
    5050int usb_generic_hid_init(struct usb_hid_dev *hid_dev, void **data);
    5151
     52void usb_generic_hid_deinit(struct usb_hid_dev *hid_dev, void *data);
     53
    5254bool usb_generic_hid_polling_callback(struct usb_hid_dev *hid_dev, void *data);
    5355
  • uspace/drv/bus/usb/usbhid/usbhid.c

    raf8c9b54 rc5b6db53  
    155155
    156156        // set the deinit callback
    157         hid_dev->subdrivers[hid_dev->subdriver_count].deinit = NULL;
     157        hid_dev->subdrivers[hid_dev->subdriver_count].deinit =
     158            usb_generic_hid_deinit;
    158159
    159160        // set subdriver count
     
    270271        hid_dev->subdrivers[count].init = usb_generic_hid_init;
    271272        hid_dev->subdrivers[count].poll = usb_generic_hid_polling_callback;
    272         hid_dev->subdrivers[count].deinit = NULL;
     273        hid_dev->subdrivers[count].deinit = usb_generic_hid_deinit;
    273274        hid_dev->subdrivers[count].poll_end = NULL;
    274275
Note: See TracChangeset for help on using the changeset viewer.