Index: uspace/drv/bus/isa/isa.c
===================================================================
--- uspace/drv/bus/isa/isa.c	(revision 0bbd13e274302c7c89dd4ea7cad7dbcc3ecfc524)
+++ uspace/drv/bus/isa/isa.c	(revision 1d5a5405546f3f0a0cab965cb3a4339c902e5e26)
@@ -73,10 +73,4 @@
 #define CHILD_FUN_CONF_PATH "/drv/isa/isa.dev"
 
-/** Obtain soft-state from device node */
-#define ISA_BUS(dev) ((isa_bus_t *) ((dev)->driver_data))
-
-/** Obtain soft-state from function node */
-#define ISA_FUN(fun) ((isa_fun_t *) ((fun)->driver_data))
-
 #define ISA_MAX_HW_RES 5
 
@@ -95,7 +89,19 @@
 } isa_fun_t;
 
+/** Obtain soft-state from device node */
+static isa_bus_t *isa_bus(ddf_dev_t *dev)
+{
+	return ddf_dev_data_get(dev);
+}
+
+/** Obtain soft-state from function node */
+static isa_fun_t *isa_fun(ddf_fun_t *fun)
+{
+	return ddf_fun_data_get(fun);
+}
+
 static hw_resource_list_t *isa_get_fun_resources(ddf_fun_t *fnode)
 {
-	isa_fun_t *fun = ISA_FUN(fnode);
+	isa_fun_t *fun = isa_fun(fnode);
 	assert(fun != NULL);
 
@@ -107,5 +113,5 @@
 	/* This is an old ugly way, copied from pci driver */
 	assert(fnode);
-	isa_fun_t *isa_fun = fnode->driver_data;
+	isa_fun_t *fun = isa_fun(fnode);
 
 	sysarg_t apic;
@@ -123,6 +129,5 @@
 		return false;
 
-	assert(isa_fun);
-	const hw_resource_list_t *res = &isa_fun->hw_resources;
+	const hw_resource_list_t *res = &fun->hw_resources;
 	assert(res);
 	for (size_t i = 0; i < res->count; ++i) {
@@ -150,6 +155,6 @@
 {
 	assert(fnode);
-	isa_fun_t *isa_fun = fnode->driver_data;
-	const hw_resource_list_t *res = &isa_fun->hw_resources;
+	isa_fun_t *fun = isa_fun(fnode);
+	const hw_resource_list_t *res = &fun->hw_resources;
 	assert(res);
 	
@@ -339,5 +344,5 @@
 
 		ddf_msg(LVL_NOTE, "Added irq 0x%x to function %s", irq,
-		    fun->fnode->name);
+		    ddf_fun_get_name(fun->fnode));
 	}
 }
@@ -355,5 +360,5 @@
 			fun->hw_resources.count++;
 			ddf_msg(LVL_NOTE, "Added dma 0x%x to function %s", dma,
-			    fun->fnode->name);
+			    ddf_fun_get_name(fun->fnode));
 			
 			return;
@@ -366,5 +371,5 @@
 			fun->hw_resources.count++;
 			ddf_msg(LVL_NOTE, "Added dma 0x%x to function %s", dma,
-			    fun->fnode->name);
+			    ddf_fun_get_name(fun->fnode));
 			
 			return;
@@ -372,5 +377,5 @@
 		
 		ddf_msg(LVL_WARN, "Skipped dma 0x%x for function %s", dma,
-		    fun->fnode->name);
+		    ddf_fun_get_name(fun->fnode));
 	}
 }
@@ -391,5 +396,5 @@
 		ddf_msg(LVL_NOTE, "Added io range (addr=0x%x, size=0x%x) to "
 		    "function %s", (unsigned int) addr, (unsigned int) len,
-		    fun->fnode->name);
+		    ddf_fun_get_name(fun->fnode));
 	}
 }
@@ -463,5 +468,5 @@
 	if (val == end) {
 		ddf_msg(LVL_ERROR, "Cannot read match score for function "
-		    "%s.", fun->fnode->name);
+		    "%s.", ddf_fun_get_name(fun->fnode));
 		return;
 	}
@@ -471,10 +476,10 @@
 	if (id == NULL) {
 		ddf_msg(LVL_ERROR, "Cannot read match ID for function %s.",
-		    fun->fnode->name);
+		    ddf_fun_get_name(fun->fnode));
 		return;
 	}
 
 	ddf_msg(LVL_DEBUG, "Adding match id '%s' with score %d to "
-	    "function %s", id, score, fun->fnode->name);
+	    "function %s", id, score, ddf_fun_get_name(fun->fnode));
 
 	rc = ddf_fun_add_match_id(fun->fnode, id, score);
@@ -579,7 +584,7 @@
 
 	/* Set device operations to the device. */
-	fun->fnode->ops = &isa_fun_ops;
-
-	ddf_msg(LVL_DEBUG, "Binding function %s.", fun->fnode->name);
+	ddf_fun_set_ops(fun->fnode, &isa_fun_ops);
+
+	ddf_msg(LVL_DEBUG, "Binding function %s.", ddf_fun_get_name(fun->fnode));
 
 	/* XXX Handle error */
@@ -614,5 +619,5 @@
 
 	ddf_msg(LVL_DEBUG, "isa_dev_add, device handle = %d",
-	    (int) dev->handle);
+	    (int) ddf_dev_get_handle(dev));
 
 	isa = ddf_dev_data_alloc(dev, sizeof(isa_bus_t));
@@ -652,5 +657,5 @@
 static int isa_dev_remove(ddf_dev_t *dev)
 {
-	isa_bus_t *isa = ISA_BUS(dev);
+	isa_bus_t *isa = isa_bus(dev);
 	int rc;
 
@@ -664,5 +669,5 @@
 		if (rc != EOK) {
 			fibril_mutex_unlock(&isa->mutex);
-			ddf_msg(LVL_ERROR, "Failed offlining %s", fun->fnode->name);
+			ddf_msg(LVL_ERROR, "Failed offlining %s", ddf_fun_get_name(fun->fnode));
 			return rc;
 		}
@@ -671,5 +676,5 @@
 		if (rc != EOK) {
 			fibril_mutex_unlock(&isa->mutex);
-			ddf_msg(LVL_ERROR, "Failed unbinding %s", fun->fnode->name);
+			ddf_msg(LVL_ERROR, "Failed unbinding %s", ddf_fun_get_name(fun->fnode));
 			return rc;
 		}
