Index: uspace/drv/usbhid/Makefile
===================================================================
--- uspace/drv/usbhid/Makefile	(revision c7dd69dff24ec2c67be481e1dc0926d2e3a46ca3)
+++ uspace/drv/usbhid/Makefile	(revision 8fd4ba0febd30b06d14b441e12b5134169bf5f21)
@@ -46,5 +46,4 @@
 	generic/hiddev.c \
 	mouse/mousedev.c \
-	lgtch-ultrax/lgtch-ultrax.c \
 	$(STOLEN_LAYOUT_SOURCES)
 
Index: uspace/drv/usbhid/kbd/kbddev.c
===================================================================
--- uspace/drv/usbhid/kbd/kbddev.c	(revision c7dd69dff24ec2c67be481e1dc0926d2e3a46ca3)
+++ uspace/drv/usbhid/kbd/kbddev.c	(revision 8fd4ba0febd30b06d14b441e12b5134169bf5f21)
@@ -176,13 +176,4 @@
 
 /*----------------------------------------------------------------------------*/
-
-static void usb_kbd_process_keycodes(const uint8_t *key_codes, size_t count,
-    uint8_t report_id, void *arg);
-
-static const usb_hid_report_in_callbacks_t usb_kbd_parser_callbacks = {
-	.keyboard = usb_kbd_process_keycodes
-};
-
-/*----------------------------------------------------------------------------*/
 /* Keyboard layouts                                                           */
 /*----------------------------------------------------------------------------*/
@@ -639,4 +630,10 @@
 {
 	assert(hid_dev->parser != NULL);
+	
+	usb_hid_report_in_callbacks_t *callbacks =
+	    (usb_hid_report_in_callbacks_t *)malloc(
+	        sizeof(usb_hid_report_in_callbacks_t));
+	
+	callbacks->keyboard = usb_kbd_process_keycodes;
 
 	usb_log_debug("Calling usb_hid_parse_report() with "
@@ -647,10 +644,10 @@
 	usb_hid_report_path_t *path = usb_hid_report_path();
 	usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0);
-	//usb_hid_report_path_set_report_id(path, 0);
+	usb_hid_report_path_set_report_id(path, 0);
 	
 	int rc = usb_hid_parse_report(hid_dev->parser, buffer,
 	    actual_size, path, 
 	    USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 
-	    &usb_kbd_parser_callbacks, hid_dev);
+	    callbacks, hid_dev);
 
 	usb_hid_report_path_free(path);
Index: pace/drv/usbhid/lgtch-ultrax/lgtch-ultrax.c
===================================================================
--- uspace/drv/usbhid/lgtch-ultrax/lgtch-ultrax.c	(revision c7dd69dff24ec2c67be481e1dc0926d2e3a46ca3)
+++ 	(revision )
@@ -1,102 +1,0 @@
-/*
- * Copyright (c) 2011 Lubos Slovak, Vojtech Horky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup drvusbhid
- * @{
- */
-/**
- * @file
- * USB Logitech UltraX Keyboard sample driver.
- */
-
-
-#include "lgtch-ultrax.h"
-#include "../usbhid.h"
-
-#include <usb/classes/hidparser.h>
-#include <usb/debug.h>
-#include <errno.h>
-#include <str_error.h>
-
-#define NAME "lgtch-ultrax"
-
-/*----------------------------------------------------------------------------*/
-
-static void usb_lgtch_process_keycodes(const uint8_t *key_codes, size_t count,
-    uint8_t report_id, void *arg);
-
-static const usb_hid_report_in_callbacks_t usb_lgtch_parser_callbacks = {
-	.keyboard = usb_lgtch_process_keycodes
-};
-
-/*----------------------------------------------------------------------------*/
-
-static void usb_lgtch_process_keycodes(const uint8_t *key_codes, size_t count,
-    uint8_t report_id, void *arg)
-{
-	// TODO: checks
-	
-	usb_log_debug(NAME " Got keys from parser (report id: %u): %s\n", 
-	    report_id, usb_debug_str_buffer(key_codes, count, 0));
-}
-
-/*----------------------------------------------------------------------------*/
-
-bool usb_lgtch_polling_callback(struct usb_hid_dev *hid_dev, 
-    uint8_t *buffer, size_t buffer_size)
-{
-	// TODO: checks
-	
-	usb_log_debug(NAME " usb_lgtch_polling_callback(%p, %p, %zu)\n",
-	    hid_dev, buffer, buffer_size);
-
-	usb_log_debug(NAME " Calling usb_hid_parse_report() with "
-	    "buffer %s\n", usb_debug_str_buffer(buffer, buffer_size, 0));
-	
-	usb_hid_report_path_t *path = usb_hid_report_path();
-	usb_hid_report_path_append_item(path, 0xc, 0);
-	usb_hid_report_path_set_report_id(path, 1);
-	
-	int rc = usb_hid_parse_report(hid_dev->parser, buffer,
-	    buffer_size, path, 
-	    USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 
-	    &usb_lgtch_parser_callbacks, hid_dev);
-
-	usb_hid_report_path_free(path);
-	
-	if (rc != EOK) {
-		usb_log_warning("Error in usb_hid_boot_keyboard_input_report():"
-		    "%s\n", str_error(rc));
-	}
-	
-	return true;
-}
-
-/**
- * @}
- */
Index: pace/drv/usbhid/lgtch-ultrax/lgtch-ultrax.h
===================================================================
--- uspace/drv/usbhid/lgtch-ultrax/lgtch-ultrax.h	(revision c7dd69dff24ec2c67be481e1dc0926d2e3a46ca3)
+++ 	(revision )
@@ -1,61 +1,0 @@
-/*
- * Copyright (c) 2011 Lubos Slovak
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup drvusbhid
- * @{
- */
-/** @file
- * USB Logitech UltraX Keyboard sample driver.
- */
-
-#ifndef USB_HID_LGTCH_ULTRAX_H_
-#define USB_HID_LGTCH_ULTRAX_H_
-
-#include <usb/devdrv.h>
-
-struct usb_hid_dev;
-//struct usb_hid_subdriver_mapping;
-
-/*----------------------------------------------------------------------------*/
-
-//extern struct usb_hid_subdriver_mapping usb_lgtch_mapping;
-
-/*----------------------------------------------------------------------------*/
-
-//int usb_lgtch_init(struct usb_hid_dev *hid_dev);
-
-bool usb_lgtch_polling_callback(struct usb_hid_dev *hid_dev, uint8_t *buffer,
-    size_t buffer_size);
-
-/*----------------------------------------------------------------------------*/
-
-#endif // USB_HID_LGTCH_ULTRAX_H_
-
-/**
- * @}
- */
Index: uspace/drv/usbhid/main.c
===================================================================
--- uspace/drv/usbhid/main.c	(revision c7dd69dff24ec2c67be481e1dc0926d2e3a46ca3)
+++ uspace/drv/usbhid/main.c	(revision 8fd4ba0febd30b06d14b441e12b5134169bf5f21)
@@ -75,6 +75,4 @@
 static int usb_hid_try_add_device(usb_device_t *dev)
 {
-	assert(dev != NULL);
-	
 	/* 
 	 * Initialize device (get and process descriptors, get address, etc.)
@@ -180,9 +178,4 @@
 	usb_log_debug("usb_hid_add_device()\n");
 	
-	if (dev == NULL) {
-		usb_log_warning("Wrong parameter given for add_device().\n");
-		return EINVAL;
-	}
-	
 	if (dev->interface_no < 0) {
 		usb_log_warning("Device is not a supported HID device.\n");
Index: uspace/drv/usbhid/mouse/mousedev.c
===================================================================
--- uspace/drv/usbhid/mouse/mousedev.c	(revision c7dd69dff24ec2c67be481e1dc0926d2e3a46ca3)
+++ uspace/drv/usbhid/mouse/mousedev.c	(revision 8fd4ba0febd30b06d14b441e12b5134169bf5f21)
@@ -157,10 +157,10 @@
 static void usb_mouse_free(usb_mouse_t **mouse_dev)
 {
-	assert(mouse_dev != NULL && *mouse_dev != NULL);
+	if (mouse_dev == NULL || *mouse_dev == NULL) {
+		return;
+	}
 	
 	// hangup phone to the console
-	if ((*mouse_dev)->console_phone >= 0) {
-		async_hangup((*mouse_dev)->console_phone);
-	}
+	async_hangup((*mouse_dev)->console_phone);
 	
 	free(*mouse_dev);
Index: uspace/drv/usbhid/subdrivers.c
===================================================================
--- uspace/drv/usbhid/subdrivers.c	(revision c7dd69dff24ec2c67be481e1dc0926d2e3a46ca3)
+++ uspace/drv/usbhid/subdrivers.c	(revision 8fd4ba0febd30b06d14b441e12b5134169bf5f21)
@@ -37,47 +37,23 @@
 #include "usb/classes/hidut.h"
 
-#include "lgtch-ultrax/lgtch-ultrax.h"
-
-static usb_hid_subdriver_usage_t path_kbd[] = {
-	{USB_HIDUT_PAGE_KEYBOARD, 0}, 
-	{0, 0}
-};
-
-static usb_hid_subdriver_usage_t lgtch_path[] = {
-	{0xc, 0},
-	{0, 0}
-};
+static usb_hid_subdriver_usage_t path_kbd[] = {{USB_HIDUT_PAGE_KEYBOARD, 0}};
 
 const usb_hid_subdriver_mapping_t usb_hid_subdrivers[] = {
 	{
 		path_kbd,
-		-1,
+		1,
 		USB_HID_PATH_COMPARE_END 
 		| USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
-		0,
-		0,
+		NULL,
+		NULL,
 		{
-			.init = usb_kbd_init,
-			.deinit = usb_kbd_deinit,
-			.poll = usb_kbd_polling_callback,
-			.poll_end = NULL
+			usb_kbd_init,
+			usb_kbd_deinit,
+			usb_kbd_polling_callback,
+			NULL
 		},
 		
 	},
-	{
-		lgtch_path,
-		1,
-		USB_HID_PATH_COMPARE_END 
-		| USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
-		0x046d,
-		0xc30e,
-		{
-			.init = NULL,
-			.deinit = NULL,
-			.poll = usb_lgtch_polling_callback,
-			.poll_end = NULL
-		}
-	},
-	{NULL, -1, 0, 0, 0, {NULL, NULL, NULL, NULL}}
+	{NULL, 0, 0, NULL, NULL, {NULL, NULL, NULL, NULL}}
 };
 
Index: uspace/drv/usbhid/subdrivers.h
===================================================================
--- uspace/drv/usbhid/subdrivers.h	(revision c7dd69dff24ec2c67be481e1dc0926d2e3a46ca3)
+++ uspace/drv/usbhid/subdrivers.h	(revision 8fd4ba0febd30b06d14b441e12b5134169bf5f21)
@@ -54,8 +54,8 @@
 typedef struct usb_hid_subdriver_mapping {
 	const usb_hid_subdriver_usage_t *usage_path;
-	int report_id;
+	int path_size;
 	int compare;
-	uint16_t vendor_id;
-	uint16_t product_id;
+	const char *vendor_id;
+	const char *product_id;
 	usb_hid_subdriver_t subdriver;
 } usb_hid_subdriver_mapping_t;
Index: uspace/drv/usbhid/usbhid.c
===================================================================
--- uspace/drv/usbhid/usbhid.c	(revision c7dd69dff24ec2c67be481e1dc0926d2e3a46ca3)
+++ uspace/drv/usbhid/usbhid.c	(revision 8fd4ba0febd30b06d14b441e12b5134169bf5f21)
@@ -67,5 +67,5 @@
 static int usb_hid_set_boot_kbd_subdriver(usb_hid_dev_t *hid_dev)
 {
-	assert(hid_dev != NULL && hid_dev->subdriver_count == 0);
+	assert(hid_dev->subdriver_count == 0);
 	
 	hid_dev->subdrivers = (usb_hid_subdriver_t *)malloc(
@@ -97,5 +97,5 @@
 static int usb_hid_set_boot_mouse_subdriver(usb_hid_dev_t *hid_dev)
 {
-	assert(hid_dev != NULL && hid_dev->subdriver_count == 0);
+	assert(hid_dev->subdriver_count == 0);
 	
 	hid_dev->subdrivers = (usb_hid_subdriver_t *)malloc(
@@ -127,5 +127,5 @@
 static int usb_hid_set_generic_hid_subdriver(usb_hid_dev_t *hid_dev)
 {
-	assert(hid_dev != NULL && hid_dev->subdriver_count == 0);
+	assert(hid_dev->subdriver_count == 0);
 	
 	hid_dev->subdrivers = (usb_hid_subdriver_t *)malloc(
@@ -164,8 +164,8 @@
 
 static bool usb_hid_path_matches(usb_hid_dev_t *hid_dev, 
-    const usb_hid_subdriver_mapping_t *mapping)
+    const usb_hid_subdriver_usage_t *path, int path_size, int compare)
 {
 	assert(hid_dev != NULL);
-	assert(mapping != NULL);
+	assert(path != NULL);
 	
 	usb_hid_report_path_t *usage_path = usb_hid_report_path();
@@ -174,27 +174,19 @@
 		return false;
 	}
-	int i = 0;
-	while (mapping->usage_path[i].usage != 0 
-	    || mapping->usage_path[i].usage_page != 0) {
+	int i;
+	for (i = 0; i < path_size; ++i) {
 		if (usb_hid_report_path_append_item(usage_path, 
-		    mapping->usage_path[i].usage_page, 
-		    mapping->usage_path[i].usage) != EOK) {
+		    path[i].usage_page, path[i].usage) != EOK) {
 			usb_log_debug("Failed to append to usage path.\n");
 			usb_hid_report_path_free(usage_path);
 			return false;
 		}
-		++i;
-	}
-	
-	if (mapping->report_id >= 0) {
-		usb_hid_report_path_set_report_id(usage_path, 
-		    mapping->report_id);
 	}
 	
 	assert(hid_dev->parser != NULL);
 	
-	usb_log_debug("Compare flags: %d\n", mapping->compare);
+	usb_log_debug("Compare flags: %d\n", compare);
 	size_t size = usb_hid_report_input_length(hid_dev->parser, usage_path, 
-	    mapping->compare);
+	    compare);
 	usb_log_debug("Size of the input report: %d\n", size);
 	
@@ -239,40 +231,35 @@
 static int usb_hid_find_subdrivers(usb_hid_dev_t *hid_dev)
 {
-	assert(hid_dev != NULL);
-	
 	const usb_hid_subdriver_t *subdrivers[USB_HID_MAX_SUBDRIVERS];
 	
 	int i = 0, count = 0;
 	const usb_hid_subdriver_mapping_t *mapping = &usb_hid_subdrivers[i];
-
-	bool ids_matched;
-	bool matched;
 	
 	while (count < USB_HID_MAX_SUBDRIVERS &&
 	    (mapping->usage_path != NULL
-	    || mapping->vendor_id != 0 || mapping->product_id != 0)) {
+	    || mapping->vendor_id != NULL
+	    || mapping->product_id != NULL)) {
 		// check the vendor & product ID
-		if (mapping->vendor_id != 0 && mapping->product_id == 0) {
-			usb_log_warning("Missing Product ID for Vendor ID %u\n",
+		if (mapping->vendor_id != NULL && mapping->product_id == NULL) {
+			usb_log_warning("Missing Product ID for Vendor ID %s\n",
 			    mapping->vendor_id);
 			return EINVAL;
 		}
-		if (mapping->product_id != 0 && mapping->vendor_id == 0) {
-			usb_log_warning("Missing Vendor ID for Product ID %u\n",
+		if (mapping->product_id != NULL && mapping->vendor_id == NULL) {
+			usb_log_warning("Missing Vendor ID for Product ID %s\n",
 			    mapping->product_id);
 			return EINVAL;
 		}
 		
-		ids_matched = false;
-		matched = false;
-		
-		if (mapping->vendor_id != 0) {
-			assert(mapping->product_id != 0);
-			usb_log_debug("Comparing device against vendor ID %u"
-			    " and product ID %u.\n", mapping->vendor_id,
+		if (mapping->vendor_id != NULL) {
+			assert(mapping->product_id != NULL);
+			usb_log_debug("Comparing device against vendor ID %s"
+			    " and product ID %s.\n", mapping->vendor_id,
 			    mapping->product_id);
 			if (usb_hid_ids_match(hid_dev, mapping)) {
-				usb_log_debug("IDs matched.\n");
-				ids_matched = true;
+				usb_log_debug("Matched.\n");
+				subdrivers[count++] = &mapping->subdriver;
+				// skip the checking of usage path
+				goto next;
 			}
 		}
@@ -280,17 +267,13 @@
 		if (mapping->usage_path != NULL) {
 			usb_log_debug("Comparing device against usage path.\n");
-			if (usb_hid_path_matches(hid_dev, mapping)) {
-				// does not matter if IDs were matched
-				matched = true;
+			if (usb_hid_path_matches(hid_dev, 
+			    mapping->usage_path, mapping->path_size,
+			    mapping->compare)) {
+				subdrivers[count++] = &mapping->subdriver;
+			} else {
+				usb_log_debug("Not matched.\n");
 			}
-		} else {
-			// matched only if IDs were matched and there is no path
-			matched = ids_matched;
-		}
-		
-		if (matched) {
-			subdrivers[count++] = &mapping->subdriver;
-		}
-		
+		}
+	next:
 		mapping = &usb_hid_subdrivers[++i];
 	}
@@ -304,6 +287,4 @@
 static int usb_hid_check_pipes(usb_hid_dev_t *hid_dev, usb_device_t *dev)
 {
-	assert(hid_dev != NULL && dev != NULL);
-	
 	int rc = EOK;
 	
