Index: uspace/drv/bus/usb/xhci/bus.c
===================================================================
--- uspace/drv/bus/usb/xhci/bus.c	(revision 2833bb4cbd3b1df768dce926e9942633366f6b10)
+++ uspace/drv/bus/usb/xhci/bus.c	(revision 7e5a12b4f66b8ed53aef622b4bbac529c94fccbe)
@@ -69,10 +69,10 @@
  * @return Error code.
  */
-static int address_device(xhci_bus_t *bus, xhci_device_t *dev)
+static int address_device(xhci_device_t *dev)
 {
 	int err;
 
 	/* Enable new slot. */
-	if ((err = hc_enable_slot(bus->hc, &dev->slot_id)) != EOK)
+	if ((err = hc_enable_slot(dev)) != EOK)
 		return err;
 	usb_log_debug2("Obtained slot ID: %u.", dev->slot_id);
@@ -100,5 +100,5 @@
 	dev->base.endpoints[0] = NULL;
 err_slot:
-	hc_disable_slot(bus->hc, dev);
+	hc_disable_slot(dev);
 	return err;
 }
@@ -193,5 +193,5 @@
 	do {
 		/* Assign an address to the device */
-		err = address_device(bus, xhci_dev);
+		err = address_device(xhci_dev);
 	} while (err == ESTALL && --retries > 0);
 
@@ -253,5 +253,5 @@
 	/* Disable the slot, dropping all endpoints. */
 	const uint32_t slot_id = xhci_dev->slot_id;
-	if ((err = hc_disable_slot(bus->hc, xhci_dev))) {
+	if ((err = hc_disable_slot(xhci_dev))) {
 		usb_log_warning("Failed to disable slot of device " XHCI_DEV_FMT ": %s",
 		    XHCI_DEV_ARGS(*xhci_dev), str_error(err));
Index: uspace/drv/bus/usb/xhci/hc.c
===================================================================
--- uspace/drv/bus/usb/xhci/hc.c	(revision 2833bb4cbd3b1df768dce926e9942633366f6b10)
+++ uspace/drv/bus/usb/xhci/hc.c	(revision 7e5a12b4f66b8ed53aef622b4bbac529c94fccbe)
@@ -714,25 +714,29 @@
 
 /**
- * Issue an Enable Slot command, returning the obtained Slot ID.
- *
- * @param slot_id Pointer where to store the obtained Slot ID.
- */
-int hc_enable_slot(xhci_hc_t *hc, uint32_t *slot_id)
-{
-	assert(hc);
-
+ * Issue an Enable Slot command. Allocate memory for the slot and fill the
+ * DCBAA with the newly created slot.
+ */
+int hc_enable_slot(xhci_device_t *dev)
+{
 	int err;
+	xhci_hc_t * const hc = bus_to_hc(dev->base.bus);
+
+	/* Prepare memory for the context */
+	if ((err = dma_buffer_alloc(&dev->dev_ctx, sizeof(xhci_device_ctx_t))))
+		return err;
+	memset(dev->dev_ctx.virt, 0, sizeof(xhci_device_ctx_t));
+
+	/* Get the slot number */
 	xhci_cmd_t cmd;
 	xhci_cmd_init(&cmd, XHCI_CMD_ENABLE_SLOT);
 
-	if ((err = xhci_cmd_sync(hc, &cmd))) {
-		goto end;
-	}
-
-	if (slot_id) {
-		*slot_id = cmd.slot_id;
-	}
-
-end:
+	err = xhci_cmd_sync(hc, &cmd);
+
+	/* Link them together */
+	if (err == EOK) {
+		dev->slot_id = cmd.slot_id;
+		hc->dcbaa[dev->slot_id] = host2xhci(64, dev->dev_ctx.phys);
+	}
+
 	xhci_cmd_fini(&cmd);
 	return err;
@@ -741,11 +745,10 @@
 /**
  * Issue a Disable Slot command for a slot occupied by device.
- *
- * Frees the device context
- */
-int hc_disable_slot(xhci_hc_t *hc, xhci_device_t *dev)
+ * Frees the device context.
+ */
+int hc_disable_slot(xhci_device_t *dev)
 {
 	int err;
-	assert(hc);
+	xhci_hc_t * const hc = bus_to_hc(dev->base.bus);
 
 	if ((err = xhci_cmd_sync_inline(hc, DISABLE_SLOT, .slot_id = dev->slot_id))) {
@@ -837,16 +840,8 @@
 	}
 
-	/* Setup and register device context */
-	if (dma_buffer_alloc(&dev->dev_ctx, sizeof(xhci_device_ctx_t)))
-		goto err;
-	memset(dev->dev_ctx.virt, 0, sizeof(xhci_device_ctx_t));
-
-	hc->dcbaa[dev->slot_id] = host2xhci(64, dev->dev_ctx.phys);
-
 	/* Issue configure endpoint command (sec 4.3.5). */
 	dma_buffer_t ictx_dma_buf;
-	if ((err = create_configure_ep_input_ctx(dev, &ictx_dma_buf))) {
-		goto err_dev_ctx;
-	}
+	if ((err = create_configure_ep_input_ctx(dev, &ictx_dma_buf)))
+		return err;
 	xhci_input_ctx_t *ictx = ictx_dma_buf.virt;
 
@@ -856,7 +851,6 @@
 
 	/* Issue Address Device command. */
-	if ((err = xhci_cmd_sync_inline(hc, ADDRESS_DEVICE, .slot_id = dev->slot_id, .input_ctx = ictx_dma_buf))) {
-		goto err_dev_ctx;
-	}
+	if ((err = xhci_cmd_sync_inline(hc, ADDRESS_DEVICE, .slot_id = dev->slot_id, .input_ctx = ictx_dma_buf)))
+		return err;
 
 	xhci_device_ctx_t *dev_ctx = dev->dev_ctx.virt;
@@ -865,10 +859,4 @@
 
 	return EOK;
-
-err_dev_ctx:
-	hc->dcbaa[dev->slot_id] = 0;
-	dma_buffer_free(&dev->dev_ctx);
-err:
-	return err;
 }
 
Index: uspace/drv/bus/usb/xhci/hc.h
===================================================================
--- uspace/drv/bus/usb/xhci/hc.h	(revision 2833bb4cbd3b1df768dce926e9942633366f6b10)
+++ uspace/drv/bus/usb/xhci/hc.h	(revision 7e5a12b4f66b8ed53aef622b4bbac529c94fccbe)
@@ -121,6 +121,6 @@
 void hc_ring_doorbell(xhci_hc_t *, unsigned, unsigned);
 
-int hc_enable_slot(xhci_hc_t *, uint32_t *);
-int hc_disable_slot(xhci_hc_t *, xhci_device_t *);
+int hc_enable_slot(xhci_device_t *);
+int hc_disable_slot(xhci_device_t *);
 int hc_address_device(xhci_device_t *, xhci_endpoint_t *);
 int hc_configure_device(xhci_device_t *);
