Index: uspace/lib/libdrv/generic/driver.c
===================================================================
--- uspace/lib/libdrv/generic/driver.c	(revision a78fa2a9d35d4b71830ba7c047cb36f2e14a33c7)
+++ uspace/lib/libdrv/generic/driver.c	(revision df747b9ce545e1eda723dbd969461898e697c40b)
@@ -103,24 +103,25 @@
 static void driver_add_device(ipc_callid_t iid, ipc_call_t *icall)
 {
-	// TODO device state - the driver may detect the device is not actually present 
-	// (old non PnP devices) or is not working properly. 
-	// We should send such information to device manager.
-	
-	ipcarg_t ret;
+	char *dev_name = NULL;
+	int res = EOK;
+	
 	device_handle_t dev_handle =  IPC_GET_ARG1(*icall);
 	device_t *dev = driver_create_device();
 	dev->handle = dev_handle;
-	async_string_receive(&dev->name, 0, NULL);
-	add_to_devices_list(dev);
-	if (driver->driver_ops->add_device(dev)) {		
+	
+	async_string_receive(&dev_name, 0, NULL);
+	dev->name = dev_name;
+	
+	add_to_devices_list(dev);		
+	res = driver->driver_ops->add_device(dev);
+	if (0 == res) {
 		printf("%s: new device with handle = %x was added.\n", driver->name, dev_handle);
-		ret = 1;
 	} else {
-		printf("%s: failed to add a new device with handle = %x.\n", driver->name, dev_handle);	
+		printf("%s: failed to add a new device with handle = %d.\n", driver->name, dev_handle);	
 		remove_from_devices_list(dev);
-		// TODO delete device		
-		ret = 0;
-	}
-	ipc_answer_0(iid, EOK);
+		delete_device(dev);		
+	}
+	
+	ipc_answer_0(iid, res);
 }
 
@@ -270,5 +271,5 @@
 }
 
-bool child_device_register(device_t *child, device_t *parent)
+int child_device_register(device_t *child, device_t *parent)
 {
 	// printf("%s: child_device_register\n", driver->name);
@@ -276,10 +277,12 @@
 	assert(NULL != child->name);
 
+	int res;
+	
 	add_to_devices_list(child);
-	if (EOK == devman_child_device_register(child->name, &child->match_ids, parent->handle, &child->handle)) {
-		return true;
+	if (EOK == (res = devman_child_device_register(child->name, &child->match_ids, parent->handle, &child->handle))) {
+		return res;
 	}
 	remove_from_devices_list(child);	
-	return false;
+	return res;
 }
 
Index: uspace/lib/libdrv/include/driver.h
===================================================================
--- uspace/lib/libdrv/include/driver.h	(revision a78fa2a9d35d4b71830ba7c047cb36f2e14a33c7)
+++ uspace/lib/libdrv/include/driver.h	(revision df747b9ce545e1eda723dbd969461898e697c40b)
@@ -109,5 +109,5 @@
 typedef struct driver_ops {
 	/** Callback method for passing a new device to the device driver.*/
-	bool (*add_device)(device_t *dev);
+	int (*add_device)(device_t *dev);
 	// TODO add other generic driver operations
 } driver_ops_t;
@@ -161,5 +161,5 @@
 }
 
-bool child_device_register(device_t *child, device_t *parent);
+int child_device_register(device_t *child, device_t *parent);
 
 
