Index: uspace/drv/bus/usb/usbhub/usbhub.c
===================================================================
--- uspace/drv/bus/usb/usbhub/usbhub.c	(revision 6626bba94c019ad8fc3a6b733df9b3bdea22554d)
+++ uspace/drv/bus/usb/usbhub/usbhub.c	(revision 205f0766b77093027f985751ecdae29d207d19d7)
@@ -85,5 +85,29 @@
 int usb_hub_device_gone(usb_device_t *usb_dev)
 {
-	return ENOTSUP;
+	assert(usb_dev);
+	usb_hub_dev_t *hub = usb_dev->driver_data;
+	assert(hub);
+	unsigned tries = 10;
+	while (hub->running) {
+		async_usleep(100000);
+		if (!tries--) {
+			usb_log_error("Can't remove hub, still running.\n");
+			return EINPROGRESS;
+		}
+	}
+
+	assert(!hub->running);
+	const int ret = ddf_fun_unbind(hub->hub_fun);
+	if (ret != EOK) {
+		usb_log_error("Failed to unbind '%s' function: %s.\n",
+		   HUB_FNC_NAME, str_error(ret));
+		return ret;
+	}
+	ddf_fun_destroy(hub->hub_fun);
+	free(hub->ports);
+	free(hub);
+	usb_dev->driver_data = NULL;
+	usb_log_info("USB hub driver, stopped and cleaned.\n");
+	return EOK;
 }
 /*----------------------------------------------------------------------------*/
@@ -126,5 +150,5 @@
 	}
 
-	//get port count and create attached_devs
+	/* Get port count and create attached_devices. */
 	opResult = usb_hub_process_hub_specific_info(hub_info);
 	if (opResult != EOK) {
@@ -157,4 +181,6 @@
 	    usb_hub_polling_terminated_callback, hub_info);
 	if (opResult != EOK) {
+		/* Function is already bound */
+		ddf_fun_unbind(hub_info->hub_fun);
 		ddf_fun_destroy(hub_info->hub_fun);
 		free(hub_info);
@@ -163,4 +189,5 @@
 		return opResult;
 	}
+	hub_info->running = true;
 	usb_log_info("Controlling hub '%s' (%zu ports).\n",
 	    hub_info->usb_device->ddf_dev->name, hub_info->port_count);
@@ -225,6 +252,8 @@
 	info->port_count = -1;
 	info->pending_ops_count = 0;
+	info->running = false;
 	fibril_mutex_initialize(&info->pending_ops_mutex);
 	fibril_condvar_initialize(&info->pending_ops_cv);
+	usb_dev->driver_data = info;
 
 	return info;
@@ -489,9 +518,5 @@
 	}
 	fibril_mutex_unlock(&hub->pending_ops_mutex);
-
-	usb_device_destroy(hub->usb_device);
-
-	free(hub->ports);
-	free(hub);
+	hub->running = false;
 }
 /**
Index: uspace/drv/bus/usb/usbhub/usbhub.h
===================================================================
--- uspace/drv/bus/usb/usbhub/usbhub.h	(revision 6626bba94c019ad8fc3a6b733df9b3bdea22554d)
+++ uspace/drv/bus/usb/usbhub/usbhub.h	(revision 205f0766b77093027f985751ecdae29d207d19d7)
@@ -75,4 +75,6 @@
 	/** Pointer to devman usbhub function. */
 	ddf_fun_t *hub_fun;
+	/** Status indicator */
+	bool running;
 };
 
