Index: uspace/drv/bus/usb/usbhub/port.c
===================================================================
--- uspace/drv/bus/usb/usbhub/port.c	(revision db71e2af5cdfe169de296e6f39b3e5eda7a966f6)
+++ uspace/drv/bus/usb/usbhub/port.c	(revision fa9d3afc435a30b776feebda588c52c598f66317)
@@ -64,5 +64,5 @@
 {
 	assert(port);
-	if (port->attached_handle != USB_DEVICE_HANDLE_INVALID)
+	if (port->device_attached)
 		return usb_hub_port_device_gone(port, hub);
 	return EOK;
@@ -139,10 +139,10 @@
 	assert(port);
 	assert(hub);
-	usb_log_debug("Interrupt at port %zu\n", port->port_number);
+	usb_log_debug("Interrupt at port %u\n", port->port_number);
 
 	usb_port_status_t status = 0;
 	const int opResult = get_port_status(port, &status);
 	if (opResult != EOK) {
-		usb_log_error("Failed to get port %zu status: %s.\n",
+		usb_log_error("Failed to get port %u status: %s.\n",
 		    port->port_number, str_error(opResult));
 		return;
@@ -153,5 +153,5 @@
 		const bool connected =
 		    (status & USB_HUB_PORT_STATUS_CONNECTION) != 0;
-		usb_log_debug("Connection change on port %zu: device %s.\n",
+		usb_log_debug("Connection change on port %u: device %s.\n",
 		    port->port_number, connected ? "attached" : "removed");
 
@@ -169,5 +169,5 @@
 			if (opResult != EOK) {
 				usb_log_error(
-				    "Cannot handle change on port %zu: %s.\n",
+				    "Cannot handle change on port %u: %s.\n",
 				    port->port_number, str_error(opResult));
 			}
@@ -183,5 +183,5 @@
 	/* Enable change, ports are automatically disabled on errors. */
 	if (status & USB_HUB_PORT_C_STATUS_ENABLED) {
-		usb_log_info("Port %zu, disabled because of errors.\n",
+		usb_log_info("Port %u, disabled because of errors.\n",
 		   port->port_number);
 		usb_hub_port_device_gone(port, hub);
@@ -190,5 +190,5 @@
 		if (rc != EOK) {
 			usb_log_error(
-			    "Failed to clear port %zu enable change feature: "
+			    "Failed to clear port %u enable change feature: "
 			    "%s.\n", port->port_number, str_error(rc));
 		}
@@ -198,5 +198,5 @@
 	/* Suspend change */
 	if (status & USB_HUB_PORT_C_STATUS_SUSPEND) {
-		usb_log_error("Port %zu went to suspend state, this should"
+		usb_log_error("Port %u went to suspend state, this should"
 		    "NOT happen as we do not support suspend state!",
 		    port->port_number);
@@ -205,5 +205,5 @@
 		if (rc != EOK) {
 			usb_log_error(
-			    "Failed to clear port %zu suspend change feature: "
+			    "Failed to clear port %u suspend change feature: "
 			    "%s.\n", port->port_number, str_error(rc));
 		}
@@ -221,5 +221,5 @@
 		if (rc != EOK) {
 			usb_log_error(
-			    "Failed to clear port %zu OC change feature: %s.\n",
+			    "Failed to clear port %u OC change feature: %s.\n",
 			    port->port_number, str_error(rc));
 		}
@@ -229,5 +229,5 @@
 			if (rc != EOK) {
 				usb_log_error(
-				    "Failed to set port %zu power after OC:"
+				    "Failed to set port %u power after OC:"
 				    " %s.\n", port->port_number, str_error(rc));
 			}
@@ -240,5 +240,5 @@
 	}
 
-	usb_log_debug("Port %zu status 0x%08" PRIx32 "\n",
+	usb_log_debug("Port %u status %#08" PRIx32 "\n",
 	    port->port_number, status);
 }
@@ -260,8 +260,8 @@
 	if (!exch)
 		return ENOMEM;
-	const int rc = usb_device_remove(exch, port->attached_handle);
+	const int rc = usb_device_remove(exch, port->port_number);
 	usb_device_bus_exchange_end(exch);
 	if (rc == EOK)
-		port->attached_handle = -1;
+		port->device_attached = false;
 	return rc;
 
@@ -286,8 +286,8 @@
 
 	if (port->reset_okay) {
-		usb_log_debug("Port %zu reset complete.\n", port->port_number);
+		usb_log_debug("Port %u reset complete.\n", port->port_number);
 	} else {
 		usb_log_warning(
-		    "Port %zu reset complete but port not enabled.\n",
+		    "Port %u reset complete but port not enabled.\n",
 		    port->port_number);
 	}
@@ -299,5 +299,5 @@
 	if (rc != EOK) {
 		usb_log_error(
-		    "Failed to clear port %zu reset change feature: %s.\n",
+		    "Failed to clear port %u reset change feature: %s.\n",
 		    port->port_number, str_error(rc));
 	}
@@ -407,5 +407,5 @@
 	port_enable(port, true);
 	if (!port->reset_completed || !port->reset_okay) {
-		usb_log_error("Failed to reset port %zu\n", port->port_number);
+		usb_log_error("Failed to reset port %u\n", port->port_number);
 		if (usb_release_default_address(exch) != EOK)
 			usb_log_warning("Failed to release default address\n");
@@ -414,9 +414,10 @@
 	}
 
-	ret = usb_device_enumerate(exch, &port->attached_handle);
+	ret = usb_device_enumerate(exch, port->port_number);
 	if (ret != EOK) {
-		usb_log_error("Failed to reset port %zu\n", port->port_number);
+		usb_log_error("Failed to enumerate device on port %u\n",
+		    port->port_number);
 		if (port_enable(port, false) != EOK) {
-			usb_log_warning("Failed to disable port %zu, NOT "
+			usb_log_warning("Failed to disable port %u, NOT "
 			    "releasing default address.\n", port->port_number);
 		} else {
@@ -426,4 +427,5 @@
 		}
 	} else {
+		port->device_attached = true;
 		if (usb_release_default_address(exch) != EOK)
 			usb_log_warning("Failed to release default address\n");
