Index: uspace/drv/uhci-hcd/batch.c
===================================================================
--- uspace/drv/uhci-hcd/batch.c	(revision 063ead6f8f7011ea1895467b62663e88d0abb573)
+++ uspace/drv/uhci-hcd/batch.c	(revision eb48f61f787b70f857c0bc82f2a18f63e8152427)
@@ -51,5 +51,5 @@
 
 
-batch_t * batch_get(device_t *dev, usb_target_t target,
+batch_t * batch_get(ddf_fun_t *fun, usb_target_t target,
     usb_transfer_type_t transfer_type, size_t max_packet_size,
     dev_speed_t speed, char *buffer, size_t size,
@@ -128,5 +128,5 @@
 	instance->buffer_size = size;
 	instance->setup_size = setup_size;
-	instance->dev = dev;
+	instance->fun = fun;
 	instance->arg = arg;
 	instance->speed = speed;
@@ -291,5 +291,5 @@
 	    err, instance->transfered_size);
 
-	instance->callback_in(instance->dev,
+	instance->callback_in(instance->fun,
 	    err, instance->transfered_size,
 	    instance->arg);
@@ -303,5 +303,5 @@
 	int err = instance->error;
 	usb_log_info("Callback OUT(%d): %d.\n", instance->transfer_type, err);
-	instance->callback_out(instance->dev,
+	instance->callback_out(instance->fun,
 	    err, instance->arg);
 }
@@ -334,5 +334,5 @@
 {
 	assert(instance);
-	uhci_t *hc = dev_to_uhci(instance->dev);
+	uhci_t *hc = fun_to_uhci(instance->fun);
 	assert(hc);
 	return uhci_schedule(hc, instance);
Index: uspace/drv/uhci-hcd/batch.h
===================================================================
--- uspace/drv/uhci-hcd/batch.h	(revision 063ead6f8f7011ea1895467b62663e88d0abb573)
+++ uspace/drv/uhci-hcd/batch.h	(revision eb48f61f787b70f857c0bc82f2a18f63e8152427)
@@ -68,5 +68,5 @@
 	size_t transfered_size;
 	int error;
-	device_t *dev;
+	ddf_fun_t *fun;
 	queue_head_t *qh;
 	transfer_descriptor_t *tds;
@@ -74,5 +74,5 @@
 } batch_t;
 
-batch_t * batch_get(device_t *dev, usb_target_t target,
+batch_t * batch_get(ddf_fun_t *fun, usb_target_t target,
     usb_transfer_type_t transfer_type, size_t max_packet_size,
     dev_speed_t speed, char *buffer, size_t size,
Index: uspace/drv/uhci-hcd/iface.c
===================================================================
--- uspace/drv/uhci-hcd/iface.c	(revision 063ead6f8f7011ea1895467b62663e88d0abb573)
+++ uspace/drv/uhci-hcd/iface.c	(revision eb48f61f787b70f857c0bc82f2a18f63e8152427)
@@ -32,5 +32,5 @@
  * @brief UHCI driver
  */
-#include <driver.h>
+#include <ddf/driver.h>
 #include <remote_usbhc.h>
 
@@ -43,8 +43,8 @@
 
 /*----------------------------------------------------------------------------*/
-static int reserve_default_address(device_t *dev, usb_speed_t speed)
+static int reserve_default_address(ddf_fun_t *fun, usb_speed_t speed)
 {
-	assert(dev);
-	uhci_t *hc = dev_to_uhci(dev);
+	assert(fun);
+	uhci_t *hc = fun_to_uhci(fun);
 	assert(hc);
 	usb_address_keeping_reserve_default(&hc->address_manager);
@@ -52,8 +52,8 @@
 }
 /*----------------------------------------------------------------------------*/
-static int release_default_address(device_t *dev)
+static int release_default_address(ddf_fun_t *fun)
 {
-	assert(dev);
-	uhci_t *hc = dev_to_uhci(dev);
+	assert(fun);
+	uhci_t *hc = fun_to_uhci(fun);
 	assert(hc);
 	usb_address_keeping_release_default(&hc->address_manager);
@@ -61,9 +61,9 @@
 }
 /*----------------------------------------------------------------------------*/
-static int request_address(device_t *dev, usb_speed_t speed,
+static int request_address(ddf_fun_t *fun, usb_speed_t speed,
     usb_address_t *address)
 {
-	assert(dev);
-	uhci_t *hc = dev_to_uhci(dev);
+	assert(fun);
+	uhci_t *hc = fun_to_uhci(fun);
 	assert(hc);
 	*address = usb_address_keeping_request(&hc->address_manager);
@@ -74,8 +74,8 @@
 /*----------------------------------------------------------------------------*/
 static int bind_address(
-  device_t *dev, usb_address_t address, devman_handle_t handle)
+  ddf_fun_t *fun, usb_address_t address, devman_handle_t handle)
 {
-	assert(dev);
-	uhci_t *hc = dev_to_uhci(dev);
+	assert(fun);
+	uhci_t *hc = fun_to_uhci(fun);
 	assert(hc);
 	usb_address_keeping_devman_bind(&hc->address_manager, address, handle);
@@ -83,8 +83,8 @@
 }
 /*----------------------------------------------------------------------------*/
-static int release_address(device_t *dev, usb_address_t address)
+static int release_address(ddf_fun_t *fun, usb_address_t address)
 {
-	assert(dev);
-	uhci_t *hc = dev_to_uhci(dev);
+	assert(fun);
+	uhci_t *hc = fun_to_uhci(fun);
 	assert(hc);
 	usb_address_keeping_release_default(&hc->address_manager);
@@ -92,5 +92,5 @@
 }
 /*----------------------------------------------------------------------------*/
-static int interrupt_out(device_t *dev, usb_target_t target,
+static int interrupt_out(ddf_fun_t *fun, usb_target_t target,
     size_t max_packet_size,
     void *data, size_t size,
@@ -99,5 +99,5 @@
 	dev_speed_t speed = FULL_SPEED;
 
-	batch_t *batch = batch_get(dev, target, USB_TRANSFER_INTERRUPT,
+	batch_t *batch = batch_get(fun, target, USB_TRANSFER_INTERRUPT,
 	    max_packet_size, speed, data, size, NULL, 0, NULL, callback, arg);
 	if (!batch)
@@ -107,5 +107,5 @@
 }
 /*----------------------------------------------------------------------------*/
-static int interrupt_in(device_t *dev, usb_target_t target,
+static int interrupt_in(ddf_fun_t *fun, usb_target_t target,
     size_t max_packet_size,
     void *data, size_t size,
@@ -114,5 +114,5 @@
 	dev_speed_t speed = FULL_SPEED;
 
-	batch_t *batch = batch_get(dev, target, USB_TRANSFER_INTERRUPT,
+	batch_t *batch = batch_get(fun, target, USB_TRANSFER_INTERRUPT,
 	    max_packet_size, speed, data, size, NULL, 0, callback, NULL, arg);
 	if (!batch)
@@ -122,5 +122,5 @@
 }
 /*----------------------------------------------------------------------------*/
-static int control_write(device_t *dev, usb_target_t target,
+static int control_write(ddf_fun_t *fun, usb_target_t target,
     size_t max_packet_size,
     void *setup_data, size_t setup_size, void *data, size_t size,
@@ -129,5 +129,5 @@
 	dev_speed_t speed = FULL_SPEED;
 
-	batch_t *batch = batch_get(dev, target, USB_TRANSFER_CONTROL,
+	batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL,
 	    max_packet_size, speed, data, size, setup_data, setup_size,
 	    NULL, callback, arg);
@@ -138,5 +138,5 @@
 }
 /*----------------------------------------------------------------------------*/
-static int control_read(device_t *dev, usb_target_t target,
+static int control_read(ddf_fun_t *fun, usb_target_t target,
     size_t max_packet_size,
     void *setup_data, size_t setup_size, void *data, size_t size,
@@ -145,5 +145,5 @@
 	dev_speed_t speed = FULL_SPEED;
 
-	batch_t *batch = batch_get(dev, target, USB_TRANSFER_CONTROL,
+	batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL,
 	    max_packet_size, speed, data, size, setup_data, setup_size, callback,
 	    NULL, arg);
Index: uspace/drv/uhci-hcd/iface.h
===================================================================
--- uspace/drv/uhci-hcd/iface.h	(revision 063ead6f8f7011ea1895467b62663e88d0abb573)
+++ uspace/drv/uhci-hcd/iface.h	(revision eb48f61f787b70f857c0bc82f2a18f63e8152427)
@@ -38,5 +38,5 @@
 #include <usbhc_iface.h>
 
-usbhc_iface_t uhci_iface;
+extern usbhc_iface_t uhci_iface;
 
 #endif
Index: uspace/drv/uhci-hcd/main.c
===================================================================
--- uspace/drv/uhci-hcd/main.c	(revision 063ead6f8f7011ea1895467b62663e88d0abb573)
+++ uspace/drv/uhci-hcd/main.c	(revision eb48f61f787b70f857c0bc82f2a18f63e8152427)
@@ -32,5 +32,6 @@
  * @brief UHCI driver
  */
-#include <driver.h>
+#include <ddf/driver.h>
+#include <ddf/interrupt.h>
 #include <usb_iface.h>
 #include <usb/ddfiface.h>
@@ -48,36 +49,6 @@
 #define NAME "uhci-hcd"
 
-static int uhci_add_device(device_t *device);
+static int uhci_add_device(ddf_dev_t *device);
 
-static int usb_iface_get_address(device_t *dev, devman_handle_t handle,
-    usb_address_t *address)
-{
-	assert(dev);
-	uhci_t *hc = dev_to_uhci(dev);
-	assert(hc);
-
-	usb_address_t addr = usb_address_keeping_find(&hc->address_manager,
-	    handle);
-	if (addr < 0) {
-		return addr;
-	}
-
-	if (address != NULL) {
-		*address = addr;
-	}
-
-	return EOK;
-}
-
-
-static usb_iface_t hc_usb_iface = {
-	.get_hc_handle = usb_iface_get_hc_handle_hc_impl,
-	.get_address = usb_iface_get_address
-};
-/*----------------------------------------------------------------------------*/
-static device_ops_t uhci_ops = {
-	.interfaces[USB_DEV_IFACE] = &hc_usb_iface,
-	.interfaces[USBHC_DEV_IFACE] = &uhci_iface
-};
 /*----------------------------------------------------------------------------*/
 static driver_ops_t uhci_driver_ops = {
@@ -90,8 +61,8 @@
 };
 /*----------------------------------------------------------------------------*/
-static void irq_handler(device_t *device, ipc_callid_t iid, ipc_call_t *call)
+static void irq_handler(ddf_dev_t *dev, ipc_callid_t iid, ipc_call_t *call)
 {
-	assert(device);
-	uhci_t *hc = dev_to_uhci(device);
+	assert(dev);
+	uhci_t *hc = dev_to_uhci(dev);
 	uint16_t status = IPC_GET_ARG1(*call);
 	assert(hc);
@@ -105,10 +76,10 @@
 }
 
-static int uhci_add_device(device_t *device)
+static int uhci_add_device(ddf_dev_t *device)
 {
 	assert(device);
 
 	usb_log_info("uhci_add_device() called\n");
-	device->ops = &uhci_ops;
+
 
 	uintptr_t io_reg_base;
@@ -131,5 +102,5 @@
 	CHECK_RET_RETURN(ret, "Failed to allocate memory for uhci hcd driver.\n");
 
-	ret = uhci_init(uhci_hc, (void*)io_reg_base, io_reg_size);
+	ret = uhci_init(uhci_hc, device, (void*)io_reg_base, io_reg_size);
 	if (ret != EOK) {
 		usb_log_error("Failed to init uhci-hcd.\n");
@@ -137,4 +108,10 @@
 		return ret;
 	}
+
+	/*
+	 * We might free uhci_hc, but that does not matter since no one
+	 * else would access driver_data anyway.
+	 */
+	device->driver_data = uhci_hc;
 
 	ret = register_interrupt_handler(device, irq, irq_handler,
@@ -147,5 +124,5 @@
 	}
 
-	device_t *rh;
+	ddf_fun_t *rh;
 	ret = setup_root_hub(&rh, device);
 	if (ret != EOK) {
@@ -155,6 +132,7 @@
 		return ret;
 	}
+	rh->driver_data = uhci_hc->ddf_instance;
 
-	ret = child_device_register(rh, device);
+	ret = ddf_fun_bind(rh);
 	if (ret != EOK) {
 		usb_log_error("Failed to register root hub.\n");
@@ -165,5 +143,4 @@
 	}
 
-	device->driver_data = uhci_hc;
 	return EOK;
 }
@@ -172,7 +149,7 @@
 {
 	sleep(3);
-	usb_log_enable(USB_LOG_LEVEL_DEBUG, NAME);
+	usb_log_enable(USB_LOG_LEVEL_INFO, NAME);
 
-	return driver_main(&uhci_driver);
+	return ddf_driver_main(&uhci_driver);
 }
 /**
Index: uspace/drv/uhci-hcd/pci.c
===================================================================
--- uspace/drv/uhci-hcd/pci.c	(revision 063ead6f8f7011ea1895467b62663e88d0abb573)
+++ uspace/drv/uhci-hcd/pci.c	(revision eb48f61f787b70f857c0bc82f2a18f63e8152427)
@@ -49,5 +49,5 @@
  * @return Error code.
  */
-int pci_get_my_registers(device_t *dev,
+int pci_get_my_registers(ddf_dev_t *dev,
     uintptr_t *io_reg_address, size_t *io_reg_size,
     int *irq_no)
@@ -122,5 +122,5 @@
 }
 /*----------------------------------------------------------------------------*/
-int pci_enable_interrupts(device_t *device)
+int pci_enable_interrupts(ddf_dev_t *device)
 {
 	int parent_phone = devman_parent_device_connect(device->handle,
Index: uspace/drv/uhci-hcd/pci.h
===================================================================
--- uspace/drv/uhci-hcd/pci.h	(revision 063ead6f8f7011ea1895467b62663e88d0abb573)
+++ uspace/drv/uhci-hcd/pci.h	(revision eb48f61f787b70f857c0bc82f2a18f63e8152427)
@@ -36,8 +36,8 @@
 #define DRV_UHCI_PCI_H
 
-#include <driver.h>
+#include <ddf/driver.h>
 
-int pci_get_my_registers(device_t *, uintptr_t *, size_t *, int *);
-int pci_enable_interrupts(device_t *device);
+int pci_get_my_registers(ddf_dev_t *, uintptr_t *, size_t *, int *);
+int pci_enable_interrupts(ddf_dev_t *);
 
 #endif
Index: uspace/drv/uhci-hcd/root_hub.c
===================================================================
--- uspace/drv/uhci-hcd/root_hub.c	(revision 063ead6f8f7011ea1895467b62663e88d0abb573)
+++ uspace/drv/uhci-hcd/root_hub.c	(revision eb48f61f787b70f857c0bc82f2a18f63e8152427)
@@ -39,20 +39,57 @@
 
 #include "root_hub.h"
+#include "uhci.h"
 
-extern device_ops_t child_ops;
+static int usb_iface_get_hc_handle_rh_impl(ddf_fun_t *root_hub_fun,
+    devman_handle_t *handle)
+{
+	ddf_fun_t *hc_fun = root_hub_fun->driver_data;
+	assert(hc_fun != NULL);
+
+	*handle = hc_fun->handle;
+
+	return EOK;
+}
+
+static int usb_iface_get_address_rh_impl(ddf_fun_t *fun, devman_handle_t handle,
+    usb_address_t *address)
+{
+	assert(fun);
+	ddf_fun_t *hc_fun = fun->driver_data;
+	assert(hc_fun);
+	uhci_t *hc = fun_to_uhci(hc_fun);
+	assert(hc);
+
+	usb_address_t addr = usb_address_keeping_find(&hc->address_manager,
+	    handle);
+	if (addr < 0) {
+		return addr;
+	}
+
+	if (address != NULL) {
+		*address = addr;
+	}
+
+	return EOK;
+}
+
+usb_iface_t usb_iface_root_hub_fun_impl = {
+	.get_hc_handle = usb_iface_get_hc_handle_rh_impl,
+	.get_address = usb_iface_get_address_rh_impl
+};
+
+static ddf_dev_ops_t root_hub_ops = {
+	.interfaces[USB_DEV_IFACE] = &usb_iface_root_hub_fun_impl
+};
+
 /*----------------------------------------------------------------------------*/
-int setup_root_hub(device_t **device, device_t *hc)
+int setup_root_hub(ddf_fun_t **fun, ddf_dev_t *hc)
 {
-	assert(device);
-	device_t *hub = create_device();
+	assert(fun);
+	int ret;
+
+	ddf_fun_t *hub = ddf_fun_create(hc, fun_inner, "root-hub");
 	if (!hub) {
 		usb_log_error("Failed to create root hub device structure.\n");
-		return ENOMEM;
-	}
-	char *name;
-	int ret = asprintf(&name, "UHCI Root Hub");
-	if (ret < 0) {
-		usb_log_error("Failed to create root hub name.\n");
-		free(hub);
 		return ENOMEM;
 	}
@@ -62,25 +99,18 @@
 	if (ret < 0) {
 		usb_log_error("Failed to create root hub match string.\n");
-		free(hub);
-		free(name);
+		ddf_fun_destroy(hub);
 		return ENOMEM;
 	}
 
-	match_id_t *match_id = create_match_id();
-	if (!match_id) {
-		usb_log_error("Failed to create root hub match id.\n");
-		free(hub);
-		free(match_str);
+	ret = ddf_fun_add_match_id(hub, match_str, 100);
+	if (ret != EOK) {
+		usb_log_error("Failed to add root hub match id.\n");
+		ddf_fun_destroy(hub);
 		return ENOMEM;
 	}
-	match_id->id = match_str;
-	match_id->score = 90;
 
-	add_match_id(&hub->match_ids, match_id);
-	hub->name = name;
-	hub->parent = hc;
-	hub->ops = &child_ops;
+	hub->ops = &root_hub_ops;
 
-	*device = hub;
+	*fun = hub;
 	return EOK;
 }
Index: uspace/drv/uhci-hcd/root_hub.h
===================================================================
--- uspace/drv/uhci-hcd/root_hub.h	(revision 063ead6f8f7011ea1895467b62663e88d0abb573)
+++ uspace/drv/uhci-hcd/root_hub.h	(revision eb48f61f787b70f857c0bc82f2a18f63e8152427)
@@ -36,7 +36,7 @@
 #define DRV_UHCI_ROOT_HUB_H
 
-#include <driver.h>
+#include <ddf/driver.h>
 
-int setup_root_hub(device_t **device, device_t *hc);
+int setup_root_hub(ddf_fun_t **device, ddf_dev_t *hc);
 
 #endif
Index: uspace/drv/uhci-hcd/uhci.c
===================================================================
--- uspace/drv/uhci-hcd/uhci.c	(revision 063ead6f8f7011ea1895467b62663e88d0abb573)
+++ uspace/drv/uhci-hcd/uhci.c	(revision eb48f61f787b70f857c0bc82f2a18f63e8152427)
@@ -33,10 +33,16 @@
  */
 #include <errno.h>
+#include <str_error.h>
 #include <adt/list.h>
+#include <libarch/ddi.h>
 
 #include <usb/debug.h>
 #include <usb/usb.h>
+#include <usb/ddfiface.h>
+#include <usb_iface.h>
 
 #include "uhci.h"
+#include "iface.h"
+
 static irq_cmd_t uhci_cmds[] = {
 	{
@@ -55,4 +61,35 @@
 };
 
+static int usb_iface_get_address(ddf_fun_t *fun, devman_handle_t handle,
+    usb_address_t *address)
+{
+	assert(fun);
+	uhci_t *hc = fun_to_uhci(fun);
+	assert(hc);
+
+	usb_address_t addr = usb_address_keeping_find(&hc->address_manager,
+	    handle);
+	if (addr < 0) {
+		return addr;
+	}
+
+	if (address != NULL) {
+		*address = addr;
+	}
+
+	return EOK;
+}
+
+
+static usb_iface_t hc_usb_iface = {
+	.get_hc_handle = usb_iface_get_hc_handle_hc_impl,
+	.get_address = usb_iface_get_address
+};
+/*----------------------------------------------------------------------------*/
+static ddf_dev_ops_t uhci_ops = {
+	.interfaces[USB_DEV_IFACE] = &hc_usb_iface,
+	.interfaces[USBHC_DEV_IFACE] = &uhci_iface
+};
+
 static int uhci_init_transfer_lists(uhci_t *instance);
 static int uhci_init_mem_structures(uhci_t *instance);
@@ -71,11 +108,27 @@
 	} else (void) 0
 
-int uhci_init(uhci_t *instance, void *regs, size_t reg_size)
+int uhci_init(uhci_t *instance, ddf_dev_t *dev, void *regs, size_t reg_size)
 {
 	assert(reg_size >= sizeof(regs_t));
+	int ret;
+
+	/*
+	 * Create UHCI function.
+	 */
+	instance->ddf_instance = ddf_fun_create(dev, fun_exposed, "uhci");
+	if (instance->ddf_instance == NULL) {
+		usb_log_error("Failed to create UHCI device function.\n");
+		return ENOMEM;
+	}
+	instance->ddf_instance->ops = &uhci_ops;
+	instance->ddf_instance->driver_data = instance;
+
+	ret = ddf_fun_bind(instance->ddf_instance);
+	CHECK_RET_RETURN(ret, "Failed to bind UHCI device function: %s.\n",
+	    str_error(ret));
 
 	/* allow access to hc control registers */
 	regs_t *io;
-	int ret = pio_enable(regs, reg_size, (void**)&io);
+	ret = pio_enable(regs, reg_size, (void**)&io);
 	CHECK_RET_RETURN(ret, "Failed to gain access to registers at %p.\n", io);
 	instance->registers = io;
Index: uspace/drv/uhci-hcd/uhci.h
===================================================================
--- uspace/drv/uhci-hcd/uhci.h	(revision 063ead6f8f7011ea1895467b62663e88d0abb573)
+++ uspace/drv/uhci-hcd/uhci.h	(revision eb48f61f787b70f857c0bc82f2a18f63e8152427)
@@ -39,4 +39,5 @@
 #include <fibril_synch.h>
 #include <adt/list.h>
+#include <ddi.h>
 
 #include <usb/addrkeep.h>
@@ -97,8 +98,10 @@
 	fid_t cleaner;
 	fid_t debug_checker;
+
+	ddf_fun_t *ddf_instance;
 } uhci_t;
 
 /* init uhci specifics in device.driver_data */
-int uhci_init(uhci_t *instance, void *regs, size_t reg_size);
+int uhci_init(uhci_t *instance, ddf_dev_t *dev, void *regs, size_t reg_size);
 
 static inline void uhci_fini(uhci_t *instance) {};
@@ -108,6 +111,9 @@
 void uhci_interrupt(uhci_t *instance, uint16_t status);
 
-static inline uhci_t * dev_to_uhci(device_t *dev)
+static inline uhci_t * dev_to_uhci(ddf_dev_t *dev)
 	{ return (uhci_t*)dev->driver_data; }
+
+static inline uhci_t * fun_to_uhci(ddf_fun_t *fun)
+	{ return (uhci_t*)fun->driver_data; }
 
 
