Index: uspace/drv/bus/usb/usbhid/main.c
===================================================================
--- uspace/drv/bus/usb/usbhid/main.c	(revision 45e78687c8f458584cd1e9a8882ce8b6e7371adc)
+++ uspace/drv/bus/usb/usbhid/main.c	(revision 555499dae7d1500a99ec5bf0a03717cf3d6f032f)
@@ -49,29 +49,25 @@
 
 /**
- * Function for adding a new device of type USB/HID/keyboard.
+ * Callback for passing a new device to the driver.
  *
- * This functions initializes required structures from the device's descriptors
- * and starts new fibril for polling the keyboard for events and another one for
- * handling auto-repeat of keys.
+ * @note Currently, only boot-protocol keyboards are supported by this driver.
  *
- * During initialization, the keyboard is switched into boot protocol, the idle
- * rate is set to 0 (infinity), resulting in the keyboard only reporting event
- * when a key is pressed or released. Finally, the LED lights are turned on 
- * according to the default setup of lock keys.
- *
- * @note By default, the keyboards is initialized with Num Lock turned on and 
- *       other locks turned off.
- * @note Currently supports only boot-protocol keyboards.
- *
- * @param dev Device to add.
+ * @param dev Structure representing the new device.
  * @return Error code.
  */
-static int usb_hid_try_add_device(usb_device_t *dev)
+static int usb_hid_device_add(usb_device_t *dev)
 {
-	assert(dev != NULL);
+	usb_log_debug("%s\n", __FUNCTION__);
 
-	/* Initialize device (get and process descriptors, get address, etc.) */
-	usb_log_debug("Initializing USB/HID device...\n");
+	if (dev == NULL) {
+		usb_log_error("Wrong parameter given for add_device().\n");
+		return EINVAL;
+	}
 
+	if (dev->interface_no < 0) {
+		usb_log_error("Failed to add HID device: endpoints not found."
+		    "\n");
+		return ENOTSUP;
+	}
 	usb_hid_dev_t *hid_dev =
 	    usb_device_data_alloc(dev, sizeof(usb_hid_dev_t));
@@ -83,5 +79,4 @@
 
 	int rc = usb_hid_init(hid_dev, dev);
-
 	if (rc != EOK) {
 		usb_log_error("Failed to initialize USB/HID device.\n");
@@ -105,5 +100,5 @@
 	/* Start automated polling function.
 	 * This will create a separate fibril that will query the device
-	 * for the data continuously 
+	 * for the data continuously.
 	 */
        rc = usb_device_auto_poll(dev,
@@ -126,43 +121,4 @@
 	}
 	hid_dev->running = true;
-
-	/*
-	 * Hurrah, device is initialized.
-	 */
-	return EOK;
-}
-/*----------------------------------------------------------------------------*/
-/**
- * Callback for passing a new device to the driver.
- *
- * @note Currently, only boot-protocol keyboards are supported by this driver.
- *
- * @param dev Structure representing the new device.
- * @return Error code.
- */
-static int usb_hid_device_add(usb_device_t *dev)
-{
-	usb_log_debug("usb_hid_device_add()\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");
-		usb_log_error("Failed to add HID device: endpoints not found."
-		    "\n");
-		return ENOTSUP;
-	}
-
-	int rc = usb_hid_try_add_device(dev);
-
-	if (rc != EOK) {
-		usb_log_warning("Device is not a supported HID device.\n");
-		usb_log_error("Failed to add HID device: %s.\n",
-		    str_error(rc));
-		return rc;
-	}
 
 	usb_log_info("HID device `%s' ready to use.\n", dev->ddf_dev->name);
Index: uspace/drv/bus/usb/usbhid/usbhid.c
===================================================================
--- uspace/drv/bus/usb/usbhid/usbhid.c	(revision 45e78687c8f458584cd1e9a8882ce8b6e7371adc)
+++ uspace/drv/bus/usb/usbhid/usbhid.c	(revision 555499dae7d1500a99ec5bf0a03717cf3d6f032f)
@@ -291,15 +291,14 @@
 
 	/* We have all subdrivers determined, save them into the hid device */
-	// TODO Dowe really need this complicated stuff if there is
+	// TODO Do we really need this complicated stuff if there is
 	// max_subdrivers limitation?
 	return usb_hid_save_subdrivers(hid_dev, subdrivers, count);
 }
-
-/*----------------------------------------------------------------------------*/
-
+/*----------------------------------------------------------------------------*/
 static int usb_hid_check_pipes(usb_hid_dev_t *hid_dev, const usb_device_t *dev)
 {
 	assert(hid_dev);
 	assert(dev);
+
 
 	if (dev->pipes[USB_HID_KBD_POLL_EP_NO].present) {
@@ -359,22 +358,27 @@
 
 /*----------------------------------------------------------------------------*/
-
+/*
+ * This functions initializes required structures from the device's descriptors
+ * and starts new fibril for polling the keyboard for events and another one for
+ * handling auto-repeat of keys.
+ *
+ * During initialization, the keyboard is switched into boot protocol, the idle
+ * rate is set to 0 (infinity), resulting in the keyboard only reporting event
+ * when a key is pressed or released. Finally, the LED lights are turned on 
+ * according to the default setup of lock keys.
+ *
+ * @note By default, the keyboards is initialized with Num Lock turned on and 
+ *       other locks turned off.
+ *
+ * @param hid_dev Device to initialize, non-NULL.
+ * @param dev USB device, non-NULL.
+ * @return Error code.
+ */
 int usb_hid_init(usb_hid_dev_t *hid_dev, usb_device_t *dev)
 {
-	int rc, i;
+	assert(hid_dev);
+	assert(dev);
 
 	usb_log_debug("Initializing HID structure...\n");
-
-	if (hid_dev == NULL) {
-		usb_log_error("Failed to init HID structure: no structure given"
-		    ".\n");
-		return EINVAL;
-	}
-
-	if (dev == NULL) {
-		usb_log_error("Failed to init HID structure: no USB device"
-		    " given.\n");
-		return EINVAL;
-	}
 
 	usb_hid_report_init(&hid_dev->report);
@@ -384,5 +388,5 @@
 	hid_dev->poll_pipe_index = -1;
 
-	rc = usb_hid_check_pipes(hid_dev, dev);
+	int rc = usb_hid_check_pipes(hid_dev, dev);
 	if (rc != EOK) {
 		return rc;
@@ -449,5 +453,5 @@
 		    hid_dev->subdriver_count);
 
-		for (i = 0; i < hid_dev->subdriver_count; ++i) {
+		for (int i = 0; i < hid_dev->subdriver_count; ++i) {
 			if (hid_dev->subdrivers[i].init != NULL) {
 				usb_log_debug("Initializing subdriver %d.\n",i);
@@ -560,5 +564,4 @@
 
 /*----------------------------------------------------------------------------*/
-
 void usb_hid_deinit(usb_hid_dev_t *hid_dev)
 {
