Index: uspace/drv/bus/usb/usbmid/explore.c
===================================================================
--- uspace/drv/bus/usb/usbmid/explore.c	(revision 350274a1230d778e7076d017c1c32bd39b04fee3)
+++ uspace/drv/bus/usb/usbmid/explore.c	(revision 87a3df7f006e090aff8b245de3e4b00a641112db)
@@ -34,4 +34,5 @@
  * Exploration of available interfaces in the USB device.
  */
+#include <ddf/driver.h>
 #include <errno.h>
 #include <str_error.h>
@@ -70,7 +71,8 @@
  * @param config_descriptor_size Size of configuration descriptor in bytes.
  * @param list List where to add the interfaces.
- */
-static void create_interfaces(const uint8_t *config_descriptor,
-    size_t config_descriptor_size, list_t *list)
+ * @return EOK on success, ENOMEM if out of memory.
+ */
+static int create_interfaces(usb_mid_t *mid, const uint8_t *config_descriptor,
+    size_t config_descriptor_size)
 {
 	const usb_dp_parser_data_t data = {
@@ -101,22 +103,40 @@
 
 		/* Skip alternate interfaces. */
-		if (interface_in_list(list, interface->interface_number)) {
+		if (interface_in_list(&mid->interface_list,
+		    interface->interface_number)) {
 			/* TODO: add the alternatives and create match ids
 			 * for them. */
 			continue;
 		}
-		usbmid_interface_t *iface = malloc(sizeof(usbmid_interface_t));
-		if (iface == NULL) {
-			//TODO: Do something about that failure.
-			break;
-		}
+
+		/* Create the function */
+		ddf_fun_t *fun = ddf_fun_create(mid->dev, fun_inner, NULL);
+		if (fun == NULL)
+			goto error;
+
+		usbmid_interface_t *iface = ddf_fun_data_alloc(fun,
+		    sizeof(usbmid_interface_t));
+		if (iface == NULL)
+			goto error;
 
 		link_initialize(&iface->link);
-		iface->fun = NULL;
+		iface->fun = fun;
 		iface->interface_no = interface->interface_number;
 		iface->interface = interface;
 
-		list_append(&iface->link, list);
-	}
+		list_append(&iface->link, &mid->interface_list);
+	}
+
+	return EOK;
+error:
+	while (!list_empty(&mid->interface_list)) {
+		link_t *link = list_first(&mid->interface_list);
+		usbmid_interface_t *iface = list_get_instance(link,
+		    usbmid_interface_t, link);
+
+		ddf_fun_destroy(iface->fun);
+	}
+
+	return ENOMEM;
 }
 
@@ -165,4 +185,6 @@
 	}
 
+	usb_mid->dev = dev->ddf_dev;
+
 	/* Create control function. */
 	usb_mid->ctl_fun = ddf_fun_create(dev->ddf_dev, fun_exposed, "ctl");
@@ -182,9 +204,7 @@
 	}
 
-
 	/* Create interface children. */
 	list_initialize(&usb_mid->interface_list);
-	create_interfaces(config_descriptor_raw, config_descriptor_size,
-	    &usb_mid->interface_list);
+	create_interfaces(usb_mid, config_descriptor_raw, config_descriptor_size);
 
 	/* Start child function for every interface. */
Index: uspace/drv/bus/usb/usbmid/usbmid.c
===================================================================
--- uspace/drv/bus/usb/usbmid/usbmid.c	(revision 350274a1230d778e7076d017c1c32bd39b04fee3)
+++ uspace/drv/bus/usb/usbmid/usbmid.c	(revision 87a3df7f006e090aff8b245de3e4b00a641112db)
@@ -30,7 +30,4 @@
  * @{
  */
-
-/* XXX Fix this */
-#define _DDF_DATA_IMPLANT
 
 /**
@@ -102,5 +99,4 @@
     const usb_standard_interface_descriptor_t *interface_descriptor)
 {
-	ddf_fun_t *child = NULL;
 	char *child_name = NULL;
 	int rc;
@@ -114,14 +110,11 @@
 	    usb_str_class(interface_descriptor->interface_class),
 	    interface_descriptor->interface_number);
-	if (rc < 0) {
+	if (rc < 0)
 		return ENOMEM;
-	}
 
-	/* Create the device. */
-	child = ddf_fun_create(parent->ddf_dev, fun_inner, child_name);
+	rc = ddf_fun_set_name(iface->fun, child_name);
 	free(child_name);
-	if (child == NULL) {
+	if (rc != EOK)
 		return ENOMEM;
-	}
 
 	match_id_list_t match_ids;
@@ -130,14 +123,11 @@
 	rc = usb_device_create_match_ids_from_interface(device_descriptor,
 	    interface_descriptor, &match_ids);
-	if (rc != EOK) {
-		ddf_fun_destroy(child);
+	if (rc != EOK)
 		return rc;
-	}
 
 	list_foreach(match_ids.ids, link, match_id_t, match_id) {
-		rc = ddf_fun_add_match_id(child, match_id->id, match_id->score);
+		rc = ddf_fun_add_match_id(iface->fun, match_id->id, match_id->score);
 		if (rc != EOK) {
 			clean_match_ids(&match_ids);
-			ddf_fun_destroy(child);
 			return rc;
 		}
@@ -145,14 +135,9 @@
 	clean_match_ids(&match_ids);
 
-	rc = ddf_fun_bind(child);
-	if (rc != EOK) {
-		/* This takes care of match_id deallocation as well. */
-		ddf_fun_destroy(child);
+	ddf_fun_set_ops(iface->fun, &child_device_ops);
+
+	rc = ddf_fun_bind(iface->fun);
+	if (rc != EOK)
 		return rc;
-	}
-
-	iface->fun = child;
-	ddf_fun_data_implant(child, iface);
-	ddf_fun_set_ops(child, &child_device_ops);
 
 	return EOK;
Index: uspace/drv/bus/usb/usbmid/usbmid.h
===================================================================
--- uspace/drv/bus/usb/usbmid/usbmid.h	(revision 350274a1230d778e7076d017c1c32bd39b04fee3)
+++ uspace/drv/bus/usb/usbmid/usbmid.h	(revision 87a3df7f006e090aff8b245de3e4b00a641112db)
@@ -60,4 +60,5 @@
 /** Container to hold all the function pointers */
 typedef struct usb_mid {
+	ddf_dev_t *dev;
 	ddf_fun_t *ctl_fun;
 	list_t interface_list;
