Index: uspace/drv/bus/usb/xhci/rh.c
===================================================================
--- uspace/drv/bus/usb/xhci/rh.c	(revision f270ecb24851cd4fe8c355f8915b678a646c564c)
+++ uspace/drv/bus/usb/xhci/rh.c	(revision f45c78f205c41f1c67dfb0cfec097c87e866c376)
@@ -276,4 +276,18 @@
 }
 
+/** Deal with a detached device.
+ */
+static int handle_disconnected_device(xhci_rh_t *rh, uint8_t port_id)
+{
+	// TODO: Find XHCI device by the port.
+	// TODO: Destroy DDF function using _gone.
+	// TODO: Remove device endpoints on the bus.
+	// TODO: Free device context.
+	// TODO: Free TRB rings.
+	// TODO: Figure out what was forgotten and free that as well.
+
+	return EOK;
+}
+
 /** Handle an incoming Port Change Detected Event.
  */
@@ -308,6 +322,9 @@
 
 			bool connected = XHCI_REG_RD(regs, XHCI_PORT_CCS);
-			if (connected)
+			if (connected) {
 				handle_connected_device(rh, i);
+			} else {
+				handle_disconnected_device(rh, i);
+			}
 		}
 
