Changeset d208f3f in mainline for uspace/lib/usbhid/src/hidreport.c


Ignore:
Timestamp:
2011-05-27T12:14:02Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2df648c2
Parents:
fb2de0a (diff), 74341ed (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:

Development branch changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhid/src/hidreport.c

    rfb2de0a rd208f3f  
    164164
    165165int usb_hid_process_report_descriptor(usb_device_t *dev,
    166     usb_hid_report_t *report)
     166    usb_hid_report_t *report, uint8_t **report_desc, size_t *report_size)
    167167{
    168168        if (dev == NULL || report == NULL) {
     
    172172        }
    173173       
    174         uint8_t *report_desc = NULL;
    175         size_t report_size;
    176        
    177         int rc = usb_hid_get_report_descriptor(dev, &report_desc,
    178             &report_size);
     174//      uint8_t *report_desc = NULL;
     175//      size_t report_size;
     176       
     177        int rc = usb_hid_get_report_descriptor(dev, report_desc, report_size);
    179178       
    180179        if (rc != EOK) {
    181180                usb_log_error("Problem with getting Report descriptor: %s.\n",
    182181                    str_error(rc));
    183                 if (report_desc != NULL) {
    184                         free(report_desc);
     182                if (*report_desc != NULL) {
     183                        free(*report_desc);
     184                        *report_desc = NULL;
    185185                }
    186186                return rc;
    187187        }
    188188       
    189         assert(report_desc != NULL);
    190        
    191         rc = usb_hid_parse_report_descriptor(report, report_desc, report_size);
     189        assert(*report_desc != NULL);
     190       
     191        rc = usb_hid_parse_report_descriptor(report, *report_desc, *report_size);
    192192        if (rc != EOK) {
    193193                usb_log_error("Problem parsing Report descriptor: %s.\n",
    194194                    str_error(rc));
    195                 free(report_desc);
     195                free(*report_desc);
     196                *report_desc = NULL;
    196197                return rc;
    197198        }
    198199       
    199200        usb_hid_descriptor_print(report);
    200         free(report_desc);
    201201       
    202202        return EOK;
Note: See TracChangeset for help on using the changeset viewer.