Changeset 1c6c4092 in mainline for uspace/drv/usbhid/hiddev.c


Ignore:
Timestamp:
2011-03-01T16:39:31Z (14 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0f31e2b, 494eaf7
Parents:
27270db
Message:

Properly destroying HID and KBD device structures.

+ Do not send LOCK keys to console.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbhid/hiddev.c

    r27270db r1c6c4092  
    270270/*----------------------------------------------------------------------------*/
    271271
     272void usbhid_dev_free(usbhid_dev_t **hid_dev)
     273{
     274        if (hid_dev == NULL || *hid_dev == NULL) {
     275                return;
     276        }
     277       
     278        // free the report descriptor
     279        if ((*hid_dev)->report_desc != NULL) {
     280                free((*hid_dev)->report_desc);
     281        }
     282        // destroy the parser
     283        if ((*hid_dev)->parser != NULL) {
     284                usb_hid_free_report_parser((*hid_dev)->parser);
     285        }
     286       
     287        // TODO: cleanup pipes
     288       
     289        free(*hid_dev);
     290        *hid_dev = NULL;
     291}
     292
     293/*----------------------------------------------------------------------------*/
     294
    272295int usbhid_dev_init(usbhid_dev_t *hid_dev, ddf_dev_t *dev,
    273296    usb_endpoint_description_t *poll_ep_desc)
Note: See TracChangeset for help on using the changeset viewer.