Index: uspace/drv/infrastructure/root/root.c
===================================================================
--- uspace/drv/infrastructure/root/root.c	(revision 3795f9c7b395df216569d51f84fce8f0f98472f2)
+++ uspace/drv/infrastructure/root/root.c	(revision 56fd7cf53b8ee7af3e78e2237e566926562e0291)
@@ -204,5 +204,5 @@
 {
 	ddf_msg(LVL_DEBUG, "root_dev_add, device handle=%" PRIun,
-	    dev->handle);
+	    ddf_dev_get_handle(dev));
 
 	/*
Index: uspace/drv/infrastructure/rootmac/rootmac.c
===================================================================
--- uspace/drv/infrastructure/rootmac/rootmac.c	(revision 3795f9c7b395df216569d51f84fce8f0f98472f2)
+++ uspace/drv/infrastructure/rootmac/rootmac.c	(revision 56fd7cf53b8ee7af3e78e2237e566926562e0291)
@@ -44,8 +44,4 @@
 #define NAME  "rootmac"
 
-/** Obtain function soft-state from DDF function node */
-#define ROOTMAC_FUN(fnode) \
-	((rootmac_fun_t *) (fnode)->driver_data)
-
 typedef struct {
 	hw_resource_list_t hw_resources;
@@ -80,11 +76,17 @@
 static ddf_dev_ops_t rootmac_fun_ops;
 
+/** Obtain function soft-state from DDF function node */
+static rootmac_fun_t *rootmac_fun(ddf_fun_t *fnode)
+{
+	return ddf_fun_data_get(fnode);
+}
+
 static bool rootmac_add_fun(ddf_dev_t *dev, const char *name,
-    const char *str_match_id, rootmac_fun_t *fun)
+    const char *str_match_id, rootmac_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. */
@@ -93,17 +95,14 @@
 		goto failure;
 	
-	fnode->driver_data = fun;
+	rootmac_fun_t *fun = ddf_fun_data_alloc(fnode, sizeof(rootmac_fun_t));
+	*fun = *fun_proto;
 	
-	/* Initialize match id list */
-	match_id = create_match_id();
-	if (match_id == NULL)
+	/* 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 = &rootmac_fun_ops;
+	ddf_fun_set_ops(fnode, &rootmac_fun_ops);
 	
 	/* Register function. */
@@ -116,7 +115,4 @@
 	
 failure:
-	if (match_id != NULL)
-		match_id->id = NULL;
-	
 	if (fnode != NULL)
 		ddf_fun_destroy(fnode);
@@ -162,5 +158,5 @@
 static hw_resource_list_t *rootmac_get_resources(ddf_fun_t *fnode)
 {
-	rootmac_fun_t *fun = ROOTMAC_FUN(fnode);
+	rootmac_fun_t *fun = rootmac_fun(fnode);
 	assert(fun != NULL);
 	
Index: uspace/drv/infrastructure/rootpc/rootpc.c
===================================================================
--- uspace/drv/infrastructure/rootpc/rootpc.c	(revision 3795f9c7b395df216569d51f84fce8f0f98472f2)
+++ uspace/drv/infrastructure/rootpc/rootpc.c	(revision 56fd7cf53b8ee7af3e78e2237e566926562e0291)
@@ -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. */
Index: uspace/drv/infrastructure/rootvirt/rootvirt.c
===================================================================
--- uspace/drv/infrastructure/rootvirt/rootvirt.c	(revision 3795f9c7b395df216569d51f84fce8f0f98472f2)
+++ uspace/drv/infrastructure/rootvirt/rootvirt.c	(revision 56fd7cf53b8ee7af3e78e2237e566926562e0291)
@@ -151,5 +151,5 @@
 {
 	int rc;
-	const char *name = rvfun->fun->name;
+	const char *name = ddf_fun_get_name(rvfun->fun);
 
 	ddf_msg(LVL_DEBUG, "rootvirt_fun_remove('%s')", name);
@@ -183,5 +183,5 @@
 	}
 
-	ddf_msg(LVL_DEBUG, "dev_add(handle=%d)", (int)dev->handle);
+	ddf_msg(LVL_DEBUG, "dev_add(handle=%d)", (int)ddf_dev_get_handle(dev));
 
 	rootvirt = ddf_dev_data_alloc(dev, sizeof(rootvirt_t));
@@ -207,5 +207,5 @@
 static int rootvirt_dev_remove(ddf_dev_t *dev)
 {
-	rootvirt_t *rootvirt = (rootvirt_t *)dev->driver_data;
+	rootvirt_t *rootvirt = (rootvirt_t *)ddf_dev_data_get(dev);
 	int rc;
 
