Index: uspace/drv/usbhid/usbhid.c
===================================================================
--- uspace/drv/usbhid/usbhid.c	(revision f3f97332d56ce8693a0ffcb97b4ffefaa24cd316)
+++ uspace/drv/usbhid/usbhid.c	(revision 19e0560ec3c93d3c587dc073d3ab014e4eb3a0b0)
@@ -63,7 +63,4 @@
 static const int USB_HID_MAX_SUBDRIVERS = 10;
 
-/** @todo What happens if this is not fibril local? */
-//static fibril_local bool report_number;
-
 /*----------------------------------------------------------------------------*/
 
@@ -206,30 +203,12 @@
 	}
 	
-//	if (mapping->report_id >= 0) {
-//		usb_hid_report_path_set_report_id(usage_path, 
-//		    mapping->report_id);
-//	}
-	
 	assert(hid_dev->report != NULL);
 	
 	usb_log_debug("Compare flags: %d\n", mapping->compare);
-//	size_t size = usb_hid_report_size(hid_dev->report, 0, 
-//	    USB_HID_REPORT_TYPE_INPUT);
-//	size_t size = 0;
 	
 	bool matches = false;
-
-//	usb_hid_report_description_t *report_des = 
-//		usb_hid_report_find_description(hid_dev->report,
-//		mapping->report_id, USB_HID_REPORT_TYPE_INPUT);
 	uint8_t report_id = mapping->report_id;
 
-	/*while(report_des != NULL)*/do {
-
-//		if((mapping->report_id) == 0 && (report_des->report_id != 0)) {
-//			usb_hid_report_path_set_report_id(usage_path,
-//				report_des->report_id);
-//		}
-					     
+	do {
 		usb_log_debug("Trying report id %u\n", report_id);
 		
@@ -247,8 +226,4 @@
 
 		if (field != NULL) {
-//			size++;
-//			field = usb_hid_report_get_sibling(hid_dev->report,
-//			    field, usage_path, mapping->compare, 
-//			    USB_HID_REPORT_TYPE_INPUT);
 			matches = true;
 			break;
@@ -258,24 +233,6 @@
 		    hid_dev->report, report_id,
 		    USB_HID_REPORT_TYPE_INPUT);
-
-//		if((mapping->report_id == 0) && (report_des->report_id != 0)) {
-//			uint8_t report_id = usb_hid_get_next_report_id(
-//				hid_dev->report, report_des->report_id,
-//			        USB_HID_REPORT_TYPE_INPUT);
-
-//			if(report_id == 0) {
-//				break;
-//			}
-
-//	 		report_des = usb_hid_report_find_description(
-//				hid_dev->report, report_id, 
-//				USB_HID_REPORT_TYPE_INPUT);
-//		}
-//		else {
-//			break;
-//		}
 	} while (!matches && report_id != 0);
 	
-//	usb_log_debug("Size of the input report: %zu\n", size);
 	usb_hid_report_path_free(usage_path);
 	
@@ -423,6 +380,5 @@
 	
 	uint8_t report_id = 0;
-	size_t size;/* = usb_hid_report_byte_size(hid_dev->report, report_id, 
-	    USB_HID_REPORT_TYPE_INPUT);*/
+	size_t size;
 	
 	size_t max_size = 0;
@@ -503,5 +459,4 @@
 	rc = usb_hid_check_pipes(hid_dev, dev);
 	if (rc != EOK) {
-		//usb_hid_free(&hid_dev);
 		return rc;
 	}
@@ -551,6 +506,4 @@
 			    == USB_HID_GENERIC_POLL_EP_NO);
 			
-			/* TODO: this has no meaning if the report descriptor
-			         is not parsed */
 			usb_log_info("Falling back to generic HID driver.\n");
 			rc = usb_hid_set_generic_hid_subdriver(hid_dev);
@@ -563,5 +516,4 @@
 		usb_log_debug("Subdriver count: %d\n", 
 		    hid_dev->subdriver_count);
-		//usb_hid_free(&hid_dev);
 		
 	} else {
@@ -619,9 +571,8 @@
 	usb_hid_dev_t *hid_dev = (usb_hid_dev_t *)arg;
 	
-//	int allocated = (hid_dev->input_report != NULL);
 	assert(hid_dev->input_report != NULL);
 	usb_log_debug("Max input report size: %zu, buffer size: %zu\n",
 	    hid_dev->max_input_report_size, buffer_size);
-	//assert(hid_dev->max_input_report_size >= buffer_size);
+
 	if (hid_dev->max_input_report_size >= buffer_size) {
 		/*! @todo This should probably be atomic. */
@@ -670,39 +621,4 @@
 /*----------------------------------------------------------------------------*/
 
-//const char *usb_hid_get_function_name(const usb_hid_dev_t *hid_dev)
-//{
-//	switch (hid_dev->poll_pipe_index) {
-//	case USB_HID_KBD_POLL_EP_NO:
-//		return HID_KBD_FUN_NAME;
-//		break;
-//	case USB_HID_MOUSE_POLL_EP_NO:
-//		return HID_MOUSE_FUN_NAME;
-//		break;
-//	default:
-//		return HID_GENERIC_FUN_NAME;
-//	}
-//}
-
-/*----------------------------------------------------------------------------*/
-
-//const char *usb_hid_get_class_name(const usb_hid_dev_t *hid_dev)
-//{
-//	// this means that only boot protocol keyboards will be connected
-//	// to the console; there is probably no better way to do this
-	
-//	switch (hid_dev->poll_pipe_index) {
-//	case USB_HID_KBD_POLL_EP_NO:
-//		return HID_KBD_CLASS_NAME;
-//		break;
-//	case USB_HID_MOUSE_POLL_EP_NO:
-//		return HID_MOUSE_CLASS_NAME;
-//		break;
-//	default:
-//		return HID_GENERIC_CLASS_NAME;
-//	}
-//}
-
-/*----------------------------------------------------------------------------*/
-
 void usb_hid_new_report(usb_hid_dev_t *hid_dev)
 {
@@ -716,18 +632,4 @@
 	return hid_dev->report_nr;
 }
-
-/*----------------------------------------------------------------------------*/
-
-//void usb_hid_report_received(void)
-//{
-//	++report_number;
-//}
-
-/*----------------------------------------------------------------------------*/
-
-//bool usb_hid_report_ready(void)
-//{
-//	return !report_received;
-//}
 
 /*----------------------------------------------------------------------------*/
