Index: uspace/drv/infrastructure/rootamdm37x/rootamdm37x.c
===================================================================
--- uspace/drv/infrastructure/rootamdm37x/rootamdm37x.c	(revision 3a0148321ef5f3074bda6eb61cba9a22ad562d33)
+++ uspace/drv/infrastructure/rootamdm37x/rootamdm37x.c	(revision 2be2506abdabb8469521db65a95b985ee11638e7)
@@ -35,4 +35,5 @@
 /** @file
  */
+#define _DDF_DATA_IMPLANT
 
 #include <ddf/driver.h>
@@ -49,8 +50,4 @@
 
 #define NAME  "rootamdm37x"
-
-/** Obtain function soft-state from DDF function node */
-#define ROOTARM_FUN(fnode) \
-	((rootamdm37x_fun_t *) (fnode)->driver_data)
 
 typedef struct {
@@ -258,46 +255,29 @@
 	ddf_msg(LVL_DEBUG, "Adding new function '%s'.", name);
 	
-	ddf_fun_t *fnode = NULL;
-	match_id_t *match_id = NULL;
-	
-	/* Create new device. */
-	fnode = ddf_fun_create(dev, fun_inner, name);
+	/* Create new device function. */
+	ddf_fun_t *fnode = ddf_fun_create(dev, fun_inner, name);
 	if (fnode == NULL)
-		goto failure;
-	
-	fnode->driver_data = (void*)fun;
-	
-	/* Initialize match id list */
-	match_id = create_match_id();
-	if (match_id == NULL)
-		goto failure;
-	
-	match_id->id = str_match_id;
-	match_id->score = 100;
-	add_match_id(&fnode->match_ids, match_id);
+		return ENOMEM;
+	
+	
+	/* Add match id */
+	if (ddf_fun_add_match_id(fnode, str_match_id, 100) != EOK) {
+		// TODO This will try to free our data!
+		ddf_fun_destroy(fnode);
+		return false;
+	}
 	
 	/* Set provided operations to the device. */
-	fnode->ops = &rootamdm37x_fun_ops;
+	ddf_fun_data_implant(fnode, (void*)fun);
+	ddf_fun_set_ops(fnode, &rootamdm37x_fun_ops);
 	
 	/* Register function. */
 	if (ddf_fun_bind(fnode) != EOK) {
 		ddf_msg(LVL_ERROR, "Failed binding function %s.", name);
-		goto failure;
+		ddf_fun_destroy(fnode);
+		return false;
 	}
 	
 	return true;
-	
-failure:
-	if (match_id != NULL)
-		match_id->id = NULL;
-	
-	if (fnode != NULL) {
-		fnode->driver_data = NULL;
-		ddf_fun_destroy(fnode);
-	}
-	
-	ddf_msg(LVL_ERROR, "Failed adding function '%s'.", name);
-	
-	return false;
 }
 
@@ -349,5 +329,5 @@
 static hw_resource_list_t *rootamdm37x_get_resources(ddf_fun_t *fnode)
 {
-	rootamdm37x_fun_t *fun = ROOTARM_FUN(fnode);
+	rootamdm37x_fun_t *fun = ddf_fun_data_get(fnode);
 	assert(fun != NULL);
 	return &fun->hw_resources;
