Index: uspace/drv/bus/usb/usbhub/usbhub.c
===================================================================
--- uspace/drv/bus/usb/usbhub/usbhub.c	(revision c44a5f113fb1e9824a1fde2de9620ec078dfdf7d)
+++ uspace/drv/bus/usb/usbhub/usbhub.c	(revision 7d9cd628da1d41c8b4af968ca48767e44d0850f8)
@@ -68,5 +68,4 @@
 
 static int usb_set_first_configuration(usb_device_t *usb_device);
-static usb_hub_dev_t * usb_hub_dev_create(usb_device_t *usb_dev);
 static int usb_hub_process_hub_specific_info(usb_hub_dev_t *hub_dev);
 static void usb_hub_over_current(const usb_hub_dev_t *hub_dev,
@@ -133,9 +132,15 @@
 	assert(usb_dev);
 	/* Create driver soft-state structure */
-	usb_hub_dev_t *hub_dev = usb_hub_dev_create(usb_dev);
+	usb_hub_dev_t *hub_dev =
+	    usb_device_data_alloc(usb_dev, sizeof(usb_hub_dev_t));
 	if (hub_dev == NULL) {
 		usb_log_error("Failed to create hun driver structure.\n");
 		return ENOMEM;
 	}
+	hub_dev->usb_device = usb_dev;
+	hub_dev->pending_ops_count = 0;
+	hub_dev->running = false;
+	fibril_mutex_initialize(&hub_dev->pending_ops_mutex);
+	fibril_condvar_initialize(&hub_dev->pending_ops_cv);
 
 	/* Create hc connection */
@@ -146,5 +151,4 @@
 		usb_log_error("Could not initialize connection to device: %s\n",
 		    str_error(opResult));
-		free(hub_dev);
 		return opResult;
 	}
@@ -155,5 +159,4 @@
 		usb_log_error("Could not set hub configuration: %s\n",
 		    str_error(opResult));
-		free(hub_dev);
 		return opResult;
 	}
@@ -164,5 +167,4 @@
 		usb_log_error("Could process hub specific info, %s\n",
 		    str_error(opResult));
-		free(hub_dev);
 		return opResult;
 	}
@@ -173,5 +175,4 @@
 	if (hub_dev->hub_fun == NULL) {
 		usb_log_error("Failed to create hub function.\n");
-		free(hub_dev);
 		return ENOMEM;
 	}
@@ -181,5 +182,4 @@
 		usb_log_error("Failed to bind hub function: %s.\n",
 		   str_error(opResult));
-		free(hub_dev);
 		ddf_fun_destroy(hub_dev->hub_fun);
 		return opResult;
@@ -193,5 +193,4 @@
 		ddf_fun_unbind(hub_dev->hub_fun);
 		ddf_fun_destroy(hub_dev->hub_fun);
-		free(hub_dev);
 		usb_log_error("Failed to create polling fibril: %s.\n",
 		    str_error(opResult));
@@ -240,30 +239,4 @@
 	}
 	return true;
-}
-/*----------------------------------------------------------------------------*/
-/**
- * create usb_hub_dev_t structure
- *
- * Does only basic copying of known information into new structure.
- * @param usb_dev usb device structure
- * @return basic usb_hub_dev_t structure
- */
-static usb_hub_dev_t * usb_hub_dev_create(usb_device_t *usb_dev)
-{
-	assert(usb_dev);
-	usb_hub_dev_t *hub_dev =
-	    usb_device_data_alloc(usb_dev, sizeof(usb_hub_dev_t));
-	if (!hub_dev)
-	    return NULL;
-
-	hub_dev->usb_device = usb_dev;
-	hub_dev->ports = NULL;
-	hub_dev->port_count = 0;
-	hub_dev->pending_ops_count = 0;
-	hub_dev->running = false;
-	fibril_mutex_initialize(&hub_dev->pending_ops_mutex);
-	fibril_condvar_initialize(&hub_dev->pending_ops_cv);
-
-	return hub_dev;
 }
 /*----------------------------------------------------------------------------*/
