Changeset 1cbb4b7 in mainline for uspace/drv/usbhid/usbhid.c
- Timestamp:
- 2011-04-10T18:28:45Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 777e336, c7bdfa7
- Parents:
- f76153ce
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhid/usbhid.c
rf76153ce r1cbb4b7 171 171 usb_hid_report_path_t *usage_path = usb_hid_report_path(); 172 172 if (usage_path == NULL) { 173 usb_log_debug("Failed to create usage path.\n"); 173 174 return false; 174 175 } … … 177 178 if (usb_hid_report_path_append_item(usage_path, 178 179 path[i].usage_page, path[i].usage) != EOK) { 180 usb_log_debug("Failed to append to usage path.\n"); 179 181 usb_hid_report_path_free(usage_path); 180 182 return false; … … 182 184 } 183 185 184 bool matches = (usb_hid_report_input_length(hid_dev->parser, usage_path, 185 compare) > 0); 186 assert(hid_dev->parser != NULL); 187 188 usb_log_debug("Compare flags: %d\n", compare); 189 size_t size = usb_hid_report_input_length(hid_dev->parser, usage_path, 190 compare); 191 usb_log_debug("Size of the input report: %d\n", size); 186 192 187 193 usb_hid_report_path_free(usage_path); 188 194 189 return matches;195 return (size > 0); 190 196 } 191 197 … … 260 266 261 267 if (mapping->usage_path != NULL) { 268 usb_log_debug("Comparing device against usage path.\n"); 262 269 if (usb_hid_path_matches(hid_dev, 263 270 mapping->usage_path, mapping->path_size, 264 271 mapping->compare)) { 265 272 subdrivers[count++] = &mapping->subdriver; 273 } else { 274 usb_log_debug("Not matched.\n"); 266 275 } 267 276 } … … 552 561 // free the subdrivers info 553 562 if ((*hid_dev)->subdrivers != NULL) { 554 free( subdrivers);563 free((*hid_dev)->subdrivers); 555 564 } 556 565
Note:
See TracChangeset
for help on using the changeset viewer.