Index: uspace/lib/libc/include/ipc/devman.h
===================================================================
--- uspace/lib/libc/include/ipc/devman.h	(revision df747b9ce545e1eda723dbd969461898e697c40b)
+++ uspace/lib/libc/include/ipc/devman.h	(revision 5af21c54a30301453f80f290f919569942bc2d67)
@@ -37,4 +37,5 @@
 #include <ipc/ipc.h>
 #include <stdlib.h>
+#include <stdio.h>
 #include <string.h>
 
@@ -100,4 +101,9 @@
 }
 
+static inline void init_match_ids(match_id_list_t *id_list)
+{
+	list_initialize(&id_list->ids);
+}
+
 static inline void clean_match_ids(match_id_list_t *ids)
 {
Index: uspace/lib/libdrv/generic/driver.c
===================================================================
--- uspace/lib/libdrv/generic/driver.c	(revision df747b9ce545e1eda723dbd969461898e697c40b)
+++ uspace/lib/libdrv/generic/driver.c	(revision 5af21c54a30301453f80f290f919569942bc2d67)
@@ -59,13 +59,4 @@
 FIBRIL_MUTEX_INITIALIZE(devices_mutex);
 
-static device_t * driver_create_device()
-{
-	device_t *dev = (device_t *)malloc(sizeof(device_t));
-	if (NULL != dev) {
-		memset(dev, 0, sizeof(device_t));
-	}
-	return dev;
-}
-
 static void add_to_devices_list(device_t *dev)
 {
@@ -78,5 +69,5 @@
 {
 	fibril_mutex_lock(&devices_mutex);
-	list_append(&dev->link, &devices);
+	list_remove(&dev->link);
 	fibril_mutex_unlock(&devices_mutex);
 }
@@ -107,5 +98,5 @@
 	
 	device_handle_t dev_handle =  IPC_GET_ARG1(*icall);
-	device_t *dev = driver_create_device();
+	device_t *dev = create_device();
 	dev->handle = dev_handle;
 	
@@ -120,5 +111,5 @@
 		printf("%s: failed to add a new device with handle = %d.\n", driver->name, dev_handle);	
 		remove_from_devices_list(dev);
-		delete_device(dev);		
+		delete_device(dev);	
 	}
 	
Index: uspace/lib/libdrv/include/driver.h
===================================================================
--- uspace/lib/libdrv/include/driver.h	(revision df747b9ce545e1eda723dbd969461898e697c40b)
+++ uspace/lib/libdrv/include/driver.h	(revision 5af21c54a30301453f80f290f919569942bc2d67)
@@ -121,8 +121,4 @@
 } driver_t;
 
-
-
-
-
 int driver_main(driver_t *drv);
 
@@ -136,6 +132,6 @@
 	if (NULL != dev) {
 		memset(dev, 0, sizeof(device_t));
-	}
-	list_initialize(&dev->match_ids.ids);
+		init_match_ids(&dev->match_ids);
+	}	
 	return dev;
 }
