Index: uspace/drv/infrastructure/rootpc/rootpc.c
===================================================================
--- uspace/drv/infrastructure/rootpc/rootpc.c	(revision 81716eb65927790775a090098b80690cb57378b6)
+++ uspace/drv/infrastructure/rootpc/rootpc.c	(revision ad780544d441f9ddecd38ab48b2e79bcea7123cb)
@@ -53,7 +53,4 @@
 
 #define NAME "rootpc"
-
-/** Obtain function soft-state from DDF function node */
-#define ROOTPC_FUN(fnode) ((rootpc_fun_t *) (fnode)->driver_data)
 
 typedef struct rootpc_fun {
@@ -101,7 +98,13 @@
 };
 
+/** Obtain function soft-state from DDF function node */
+static rootpc_fun_t *rootpc_fun(ddf_fun_t *fnode)
+{
+	return ddf_fun_data_get(fnode);
+}
+
 static hw_resource_list_t *rootpc_get_resources(ddf_fun_t *fnode)
 {
-	rootpc_fun_t *fun = ROOTPC_FUN(fnode);
+	rootpc_fun_t *fun = rootpc_fun(fnode);
 	
 	assert(fun != NULL);
@@ -126,10 +129,10 @@
 static bool
 rootpc_add_fun(ddf_dev_t *dev, const char *name, const char *str_match_id,
-    rootpc_fun_t *fun)
+    rootpc_fun_t *fun_proto)
 {
 	ddf_msg(LVL_DEBUG, "Adding new function '%s'.", name);
 	
 	ddf_fun_t *fnode = NULL;
-	match_id_t *match_id = NULL;
+	int rc;
 	
 	/* Create new device. */
@@ -138,17 +141,14 @@
 		goto failure;
 	
-	fnode->driver_data = fun;
-	
-	/* Initialize match id list */
-	match_id = create_match_id();
-	if (match_id == NULL)
+	rootpc_fun_t *fun = ddf_fun_data_alloc(fnode, sizeof(rootpc_fun_t));
+	*fun = *fun_proto;
+	
+	/* Add match ID */
+	rc = ddf_fun_add_match_id(fnode, str_match_id, 100);
+	if (rc != EOK)
 		goto failure;
 	
-	match_id->id = str_match_id;
-	match_id->score = 100;
-	add_match_id(&fnode->match_ids, match_id);
-	
 	/* Set provided operations to the device. */
-	fnode->ops = &rootpc_fun_ops;
+	ddf_fun_set_ops(fnode, &rootpc_fun_ops);
 	
 	/* Register function. */
@@ -161,7 +161,4 @@
 	
 failure:
-	if (match_id != NULL)
-		match_id->id = NULL;
-	
 	if (fnode != NULL)
 		ddf_fun_destroy(fnode);
@@ -186,5 +183,5 @@
 {
 	ddf_msg(LVL_DEBUG, "rootpc_dev_add, device handle = %d",
-	    (int)dev->handle);
+	    (int)ddf_dev_get_handle(dev));
 	
 	/* Register functions. */
