Index: uspace/srv/devman/drv_conn.c
===================================================================
--- uspace/srv/devman/drv_conn.c	(revision a46e56be16ae82f0d007dd26c68b250f3f725ae0)
+++ uspace/srv/devman/drv_conn.c	(revision a1aecb12e1acd6c228cecd2e91a411a9fb169a0c)
@@ -64,5 +64,5 @@
 
 /** Register running driver. */
-static driver_t *devman_driver_register(cap_call_handle_t chandle, ipc_call_t *call)
+static driver_t *devman_driver_register(ipc_call_t *call)
 {
 	driver_t *driver = NULL;
@@ -74,5 +74,5 @@
 	errno_t rc = async_data_write_accept((void **) &drv_name, true, 0, 0, 0, 0);
 	if (rc != EOK) {
-		async_answer_0(chandle, rc);
+		async_answer_0(call, rc);
 		return NULL;
 	}
@@ -87,5 +87,5 @@
 		free(drv_name);
 		drv_name = NULL;
-		async_answer_0(chandle, ENOENT);
+		async_answer_0(call, ENOENT);
 		return NULL;
 	}
@@ -101,5 +101,5 @@
 		    driver->name);
 		fibril_mutex_unlock(&driver->driver_mutex);
-		async_answer_0(chandle, EEXIST);
+		async_answer_0(call, EEXIST);
 		return NULL;
 	}
@@ -126,5 +126,5 @@
 	if (!driver->sess) {
 		fibril_mutex_unlock(&driver->driver_mutex);
-		async_answer_0(chandle, ENOTSUP);
+		async_answer_0(call, ENOTSUP);
 		return NULL;
 	}
@@ -146,5 +146,5 @@
 		    "for driver `%s'.", driver->name);
 		fibril_mutex_unlock(&driver->driver_mutex);
-		async_answer_0(chandle, ENOMEM);
+		async_answer_0(call, ENOMEM);
 		return NULL;
 	}
@@ -153,5 +153,5 @@
 	fibril_mutex_unlock(&driver->driver_mutex);
 
-	async_answer_0(chandle, EOK);
+	async_answer_0(call, EOK);
 	return driver;
 }
@@ -166,13 +166,12 @@
 {
 	match_id_t *match_id = create_match_id();
-	cap_call_handle_t chandle;
 	ipc_call_t call;
 	errno_t rc = 0;
 
-	chandle = async_get_call(&call);
+	async_get_call(&call);
 	if (DEVMAN_ADD_MATCH_ID != IPC_GET_IMETHOD(call)) {
 		log_msg(LOG_DEFAULT, LVL_ERROR,
 		    "Invalid protocol when trying to receive match id.");
-		async_answer_0(chandle, EINVAL);
+		async_answer_0(&call, EINVAL);
 		delete_match_id(match_id);
 		return EINVAL;
@@ -181,9 +180,9 @@
 	if (match_id == NULL) {
 		log_msg(LOG_DEFAULT, LVL_ERROR, "Failed to allocate match id.");
-		async_answer_0(chandle, ENOMEM);
+		async_answer_0(&call, ENOMEM);
 		return ENOMEM;
 	}
 
-	async_answer_0(chandle, EOK);
+	async_answer_0(&call, EOK);
 
 	match_id->score = IPC_GET_ARG1(call);
@@ -230,5 +229,5 @@
  * Child devices are registered by their parent's device driver.
  */
-static void devman_add_function(cap_call_handle_t chandle, ipc_call_t *call)
+static void devman_add_function(ipc_call_t *call)
 {
 	fun_type_t ftype = (fun_type_t) IPC_GET_ARG1(*call);
@@ -239,5 +238,5 @@
 	dev_node_t *pdev = find_dev_node(&device_tree, dev_handle);
 	if (pdev == NULL) {
-		async_answer_0(chandle, ENOENT);
+		async_answer_0(call, ENOENT);
 		return;
 	}
@@ -250,13 +249,13 @@
 
 		dev_del_ref(pdev);
-		async_answer_0(chandle, EINVAL);
+		async_answer_0(call, EINVAL);
 		return;
 	}
 
 	char *fun_name = NULL;
-	errno_t rc = async_data_write_accept((void **)&fun_name, true, 0, 0, 0, 0);
+	errno_t rc = async_data_write_accept((void **) &fun_name, true, 0, 0, 0, 0);
 	if (rc != EOK) {
 		dev_del_ref(pdev);
-		async_answer_0(chandle, rc);
+		async_answer_0(call, rc);
 		return;
 	}
@@ -268,5 +267,5 @@
 		fibril_rwlock_write_unlock(&tree->rwlock);
 		dev_del_ref(pdev);
-		async_answer_0(chandle, ENOENT);
+		async_answer_0(call, ENOENT);
 		return;
 	}
@@ -278,5 +277,5 @@
 		fibril_rwlock_write_unlock(&tree->rwlock);
 		dev_del_ref(pdev);
-		async_answer_0(chandle, EEXIST);
+		async_answer_0(call, EEXIST);
 		printf(NAME ": Warning, driver tried to register `%s' twice.\n",
 		    fun_name);
@@ -303,5 +302,5 @@
 		fun_del_ref(fun);
 		delete_fun_node(fun);
-		async_answer_0(chandle, ENOMEM);
+		async_answer_0(call, ENOMEM);
 		return;
 	}
@@ -317,5 +316,5 @@
 		fun_busy_unlock(fun);
 		fun_del_ref(fun);
-		async_answer_0(chandle, rc);
+		async_answer_0(call, rc);
 		return;
 	}
@@ -325,8 +324,8 @@
 
 	/* Return device handle to parent's driver. */
-	async_answer_1(chandle, EOK, fun->handle);
-}
-
-static void devman_add_function_to_cat(cap_call_handle_t chandle, ipc_call_t *call)
+	async_answer_1(call, EOK, fun->handle);
+}
+
+static void devman_add_function_to_cat(ipc_call_t *call)
 {
 	devman_handle_t handle = IPC_GET_ARG1(*call);
@@ -339,5 +338,5 @@
 	    0, 0, 0, 0);
 	if (rc != EOK) {
-		async_answer_0(chandle, rc);
+		async_answer_0(call, rc);
 		return;
 	}
@@ -345,5 +344,5 @@
 	fun_node_t *fun = find_fun_node(&device_tree, handle);
 	if (fun == NULL) {
-		async_answer_0(chandle, ENOENT);
+		async_answer_0(call, ENOENT);
 		return;
 	}
@@ -354,5 +353,5 @@
 	if (fun->state == FUN_REMOVED) {
 		fibril_rwlock_read_unlock(&device_tree.rwlock);
-		async_answer_0(chandle, ENOENT);
+		async_answer_0(call, ENOENT);
 		return;
 	}
@@ -371,5 +370,5 @@
 	fun_del_ref(fun);
 
-	async_answer_0(chandle, rc);
+	async_answer_0(call, rc);
 }
 
@@ -377,6 +376,5 @@
  *
  */
-static void devman_drv_fun_online(cap_call_handle_t icall_handle, ipc_call_t *icall,
-    driver_t *drv)
+static void devman_drv_fun_online(ipc_call_t *icall, driver_t *drv)
 {
 	fun_node_t *fun;
@@ -387,5 +385,5 @@
 	fun = find_fun_node(&device_tree, IPC_GET_ARG1(*icall));
 	if (fun == NULL) {
-		async_answer_0(icall_handle, ENOENT);
+		async_answer_0(icall, ENOENT);
 		return;
 	}
@@ -398,5 +396,5 @@
 		fun_busy_unlock(fun);
 		fun_del_ref(fun);
-		async_answer_0(icall_handle, ENOENT);
+		async_answer_0(icall, ENOENT);
 		return;
 	}
@@ -407,5 +405,5 @@
 		fun_busy_unlock(fun);
 		fun_del_ref(fun);
-		async_answer_0(icall_handle, rc);
+		async_answer_0(icall, rc);
 		return;
 	}
@@ -414,5 +412,5 @@
 	fun_del_ref(fun);
 
-	async_answer_0(icall_handle, EOK);
+	async_answer_0(icall, EOK);
 }
 
@@ -421,6 +419,5 @@
  *
  */
-static void devman_drv_fun_offline(cap_call_handle_t icall_handle, ipc_call_t *icall,
-    driver_t *drv)
+static void devman_drv_fun_offline(ipc_call_t *icall, driver_t *drv)
 {
 	fun_node_t *fun;
@@ -429,5 +426,5 @@
 	fun = find_fun_node(&device_tree, IPC_GET_ARG1(*icall));
 	if (fun == NULL) {
-		async_answer_0(icall_handle, ENOENT);
+		async_answer_0(icall, ENOENT);
 		return;
 	}
@@ -439,5 +436,5 @@
 		fun_busy_unlock(fun);
 		fun_del_ref(fun);
-		async_answer_0(icall_handle, ENOENT);
+		async_answer_0(icall, ENOENT);
 		return;
 	}
@@ -448,5 +445,5 @@
 		fun_busy_unlock(fun);
 		fun_del_ref(fun);
-		async_answer_0(icall_handle, rc);
+		async_answer_0(icall, rc);
 		return;
 	}
@@ -454,9 +451,9 @@
 	fun_busy_unlock(fun);
 	fun_del_ref(fun);
-	async_answer_0(icall_handle, EOK);
+	async_answer_0(icall, EOK);
 }
 
 /** Remove function. */
-static void devman_remove_function(cap_call_handle_t chandle, ipc_call_t *call)
+static void devman_remove_function(ipc_call_t *call)
 {
 	devman_handle_t fun_handle = IPC_GET_ARG1(*call);
@@ -466,5 +463,5 @@
 	fun_node_t *fun = find_fun_node(&device_tree, fun_handle);
 	if (fun == NULL) {
-		async_answer_0(chandle, ENOENT);
+		async_answer_0(call, ENOENT);
 		return;
 	}
@@ -481,5 +478,5 @@
 		fun_busy_unlock(fun);
 		fun_del_ref(fun);
-		async_answer_0(chandle, ENOENT);
+		async_answer_0(call, ENOENT);
 		return;
 	}
@@ -523,5 +520,5 @@
 				fun_busy_unlock(fun);
 				fun_del_ref(fun);
-				async_answer_0(chandle, gone_rc);
+				async_answer_0(call, gone_rc);
 				return;
 			}
@@ -551,5 +548,5 @@
 				fun_busy_unlock(fun);
 				fun_del_ref(fun);
-				async_answer_0(chandle, EIO);
+				async_answer_0(call, EIO);
 				return;
 			}
@@ -567,5 +564,5 @@
 
 	log_msg(LOG_DEFAULT, LVL_DEBUG, "devman_remove_function() succeeded.");
-	async_answer_0(chandle, EOK);
+	async_answer_0(call, EOK);
 }
 
@@ -586,5 +583,5 @@
 
 /** Function for handling connections from a driver to the device manager. */
-void devman_connection_driver(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
+void devman_connection_driver(ipc_call_t *icall, void *arg)
 {
 	client_t *client;
@@ -592,5 +589,5 @@
 
 	/* Accept the connection. */
-	async_answer_0(icall_handle, EOK);
+	async_answer_0(icall, EOK);
 
 	client = async_get_client_data();
@@ -602,5 +599,5 @@
 	while (true) {
 		ipc_call_t call;
-		cap_call_handle_t chandle = async_get_call(&call);
+		async_get_call(&call);
 
 		if (!IPC_GET_IMETHOD(call))
@@ -613,5 +610,5 @@
 			if (driver == NULL) {
 				/* First call must be to DEVMAN_DRIVER_REGISTER */
-				async_answer_0(chandle, ENOTSUP);
+				async_answer_0(&call, ENOTSUP);
 				continue;
 			}
@@ -623,27 +620,27 @@
 			if (client->driver != NULL) {
 				fibril_mutex_unlock(&client->mutex);
-				async_answer_0(chandle, EINVAL);
+				async_answer_0(&call, EINVAL);
 				continue;
 			}
-			client->driver = devman_driver_register(chandle, &call);
+			client->driver = devman_driver_register(&call);
 			fibril_mutex_unlock(&client->mutex);
 			break;
 		case DEVMAN_ADD_FUNCTION:
-			devman_add_function(chandle, &call);
+			devman_add_function(&call);
 			break;
 		case DEVMAN_ADD_DEVICE_TO_CATEGORY:
-			devman_add_function_to_cat(chandle, &call);
+			devman_add_function_to_cat(&call);
 			break;
 		case DEVMAN_DRV_FUN_ONLINE:
-			devman_drv_fun_online(chandle, &call, driver);
+			devman_drv_fun_online(&call, driver);
 			break;
 		case DEVMAN_DRV_FUN_OFFLINE:
-			devman_drv_fun_offline(chandle, &call, driver);
+			devman_drv_fun_offline(&call, driver);
 			break;
 		case DEVMAN_REMOVE_FUNCTION:
-			devman_remove_function(chandle, &call);
+			devman_remove_function(&call);
 			break;
 		default:
-			async_answer_0(chandle, EINVAL);
+			async_answer_0(&call, EINVAL);
 			break;
 		}
