Index: uspace/srv/devmap/devmap.c
===================================================================
--- uspace/srv/devmap/devmap.c	(revision 215e375440748700b8ba4a90595039cbbd76cf85)
+++ uspace/srv/devmap/devmap.c	(revision 2f65fb0385da0c900a5fccf78c39635584c19d93)
@@ -45,6 +45,7 @@
 #include <stdlib.h>
 #include <string.h>
-
-#include "devmap.h"
+#include <ipc/devmap.h>
+
+#define NAME "devmap"
 
 
@@ -113,8 +114,6 @@
 	}
 
-	if (item == &devices_list) {
-		printf("DEVMAP: no device named %s.\n", name);
+	if (item == &devices_list)
 		return NULL;
-	}
 
 	device = list_get_instance(item, devmap_device_t, devices);
@@ -204,5 +203,4 @@
 	 */
 	if (!ipc_data_write_receive(&callid, &name_size)) {
-		printf("Unexpected request.\n");
 		free(driver);
 		ipc_answer_0(callid, EREFUSED);
@@ -212,6 +210,4 @@
 
 	if (name_size > DEVMAP_NAME_MAXLEN) {
-		printf("Too logn name: %u: maximum is %u.\n", name_size,
-		    DEVMAP_NAME_MAXLEN);
 		free(driver);
 		ipc_answer_0(callid, EINVAL);
@@ -224,5 +220,4 @@
 	 */
 	if (NULL == (driver->name = (char *)malloc(name_size + 1))) {
-		printf("Cannot allocate space for driver name.\n");
 		free(driver);
 		ipc_answer_0(callid, ENOMEM);
@@ -235,5 +230,4 @@
 	 */
 	if (EOK != ipc_data_write_finalize(callid, driver->name, name_size)) {
-		printf("Cannot read driver name.\n");
 		free(driver->name);
 		free(driver);
@@ -244,6 +238,4 @@
 	driver->name[name_size] = 0;
 
-	printf("Read driver name: '%s'.\n", driver->name);
-
 	/* Initialize futex for list of devices owned by this driver */
 	futex_initialize(&(driver->devices_futex), 1);
@@ -260,6 +252,4 @@
 
 	if (IPC_M_CONNECT_TO_ME != IPC_GET_METHOD(call)) {
-		printf("DEVMAP: Unexpected method: %u.\n",
-		    IPC_GET_METHOD(call));
 		ipc_answer_0(callid, ENOTSUP);
 		
@@ -289,8 +279,6 @@
 	
 	ipc_answer_0(iid, EOK);
-	printf("Driver registered.\n");
 
 	*odriver = driver;
-	return;
 }
 
@@ -302,10 +290,7 @@
 	devmap_device_t *device;
 
-	if (NULL == driver) {
-		printf("Error: driver == NULL.\n");
+	if (NULL == driver)
 		return EEXISTS;
-	}
-
-	printf("Unregister driver '%s'.\n", driver->name);
+	
 	futex_down(&drivers_list_futex);	
 
@@ -323,5 +308,4 @@
 		device = list_get_instance(driver->devices.next,
 		    devmap_device_t, driver_devices);
-		printf("Unregister device '%s'.\n", device->name);
 		devmap_device_unregister_core(device);
 	}
@@ -338,6 +322,4 @@
 	free(driver);
 
-	printf("Driver unregistered.\n");
-
 	return EOK;
 }
@@ -355,5 +337,4 @@
 
 	if (NULL == driver) {
-		printf("Invalid driver registration.\n");
 		ipc_answer_0(iid, EREFUSED);
 		return;
@@ -362,6 +343,5 @@
 	/* Create new device entry */
 	if (NULL ==
-	    (device = (devmap_device_t *)malloc(sizeof(devmap_device_t)))) {
-		printf("Cannot allocate new device.\n");
+	    (device = (devmap_device_t *) malloc(sizeof(devmap_device_t)))) {
 		ipc_answer_0(iid, ENOMEM);
 		return;
@@ -371,5 +351,4 @@
 	if (!ipc_data_write_receive(&callid, &size)) {
 		free(device);
-		printf("Cannot read device name.\n");
 		ipc_answer_0(iid, EREFUSED);
 		return;
@@ -377,5 +356,4 @@
 
 	if (size > DEVMAP_NAME_MAXLEN) {
-		printf("Too long device name: %u.\n", size);
 		free(device);
 		ipc_answer_0(callid, EINVAL);
@@ -383,10 +361,9 @@
 		return;
 	}
-
-		/* +1 for terminating \0 */
-	device->name = (char *)malloc(size + 1);
+	
+	/* +1 for terminating \0 */
+	device->name = (char *) malloc(size + 1);
 
 	if (NULL == device->name) {
-		printf("Cannot read device name.\n");
 		free(device);
 		ipc_answer_0(callid, ENOMEM);
@@ -405,5 +382,5 @@
 	/* Check that device with such name is not already registered */
 	if (NULL != devmap_device_find_name(device->name)) {
-		printf("Device '%s' already registered.\n", device->name);
+		printf(NAME ": Device '%s' already registered\n", device->name);
 		futex_up(&devices_list_futex);	
 		free(device->name);
@@ -429,8 +406,5 @@
 	futex_up(&devices_list_futex);	
 
-	printf("Device '%s' registered.\n", device->name);	
 	ipc_answer_1(iid, EOK, device->handle);
-
-	return;
 }
 
@@ -462,6 +436,4 @@
 
 	if (NULL == dev) {
-		printf("DEVMAP: No registered device with handle %d.\n",
-		    handle);
 		ipc_answer_0(callid, ENOENT);
 		return;
@@ -470,5 +442,4 @@
 	ipc_forward_fast(callid, dev->driver->phone, (ipcarg_t)(dev->handle),
 	    IPC_GET_ARG3(*call), 0, IPC_FF_NONE);
-	return;
 }
 
@@ -485,5 +456,4 @@
 	ipcarg_t retval;
 	
-	
 	/* 
 	 * Wait for incoming message with device name (but do not
@@ -529,14 +499,9 @@
 	 */
 	if (NULL == dev) {
-		printf("DEVMAP: device %s has not been registered.\n", name);
 		ipc_answer_0(iid, ENOENT);
 		return;
 	}
 
-	printf("DEVMAP: device %s has handler %d.\n", name, dev->handle);
-		
 	ipc_answer_1(iid, EOK, dev->handle);
-
-	return;
 }
 
@@ -575,6 +540,4 @@
 */	
 	/* TODO: send name in response */
-
-	return;
 }
 
@@ -582,6 +545,5 @@
  *
  */
-static void
-devmap_connection_driver(ipc_callid_t iid, ipc_call_t *icall)
+static void devmap_connection_driver(ipc_callid_t iid, ipc_call_t *icall)
 {
 	ipc_callid_t callid;
@@ -594,8 +556,6 @@
 	devmap_driver_register(&driver);
 
-	if (NULL == driver) {
-		printf("DEVMAP: driver registration failed.\n");
-		return;
-	}
+	if (NULL == driver)
+		return;
 	
 	while (cont) {
@@ -604,11 +564,8 @@
  		switch (IPC_GET_METHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
-			printf("DEVMAP: connection hung up.\n");
 			cont = false;
 			continue; /* Exit thread */
 		case DEVMAP_DRIVER_UNREGISTER:
-			printf("DEVMAP: unregister driver.\n");
 			if (NULL == driver) {
-				printf("DEVMAP: driver was not registered!\n");
 				ipc_answer_0(callid, ENOENT);
 			} else {
@@ -650,6 +607,5 @@
  *
  */
-static void
-devmap_connection_client(ipc_callid_t iid, ipc_call_t *icall)
+static void devmap_connection_client(ipc_callid_t iid, ipc_call_t *icall)
 {
 	ipc_callid_t callid;
@@ -664,5 +620,4 @@
  		switch (IPC_GET_METHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
-			printf("DEVMAP: connection hung up.\n");
 			cont = false;
 			continue; /* Exit thread */
@@ -687,12 +642,8 @@
  *
  */
-static void
-devmap_connection(ipc_callid_t iid, ipc_call_t *icall)
-{
-
-	printf("DEVMAP: new connection.\n");
-
-		/* Select interface */
-	switch ((ipcarg_t)(IPC_GET_ARG1(*icall))) {
+static void devmap_connection(ipc_callid_t iid, ipc_call_t *icall)
+{
+	/* Select interface */
+	switch ((ipcarg_t) (IPC_GET_ARG1(*icall))) {
 	case DEVMAP_DRIVER:
 		devmap_connection_driver(iid, icall);
@@ -702,19 +653,12 @@
 		break;
 	case DEVMAP_CONNECT_TO_DEVICE:
-			/* Connect client to selected device */
-		printf("DEVMAP: connect to device %d.\n",
-		    IPC_GET_ARG2(*icall));
+		/* Connect client to selected device */
 		devmap_forward(iid, icall);
 		break;
 	default:
 		ipc_answer_0(iid, ENOENT); /* No such interface */
-		printf("DEVMAP: Unknown interface %u.\n",
-		    (ipcarg_t)(IPC_GET_ARG1(*icall)));
 	}
 
 	/* Cleanup */
-	
-	printf("DEVMAP: connection closed.\n");
-	return;
 }
 
@@ -724,14 +668,14 @@
 int main(int argc, char *argv[])
 {
+	printf(NAME ": HelenOS Device Mapper\n");
+	
 	ipcarg_t phonead;
 
-	printf("DEVMAP: HelenOS device mapper.\n");
-
 	if (devmap_init() != 0) {
-		printf("Error while initializing DEVMAP service.\n");
+		printf(NAME ": Error while initializing service\n");
 		return -1;
 	}
-
-		/* Set a handler of incomming connections */
+	
+	/* Set a handler of incomming connections */
 	async_set_client_connection(devmap_connection);
 
@@ -740,4 +684,5 @@
 		return -1;
 	
+	printf(NAME ": Accepting connections\n");
 	async_manager();
 	/* Never reached */
@@ -748,3 +693,2 @@
  * @}
  */
-
Index: uspace/srv/devmap/devmap.h
===================================================================
--- uspace/srv/devmap/devmap.h	(revision 215e375440748700b8ba4a90595039cbbd76cf85)
+++ 	(revision )
@@ -1,99 +1,0 @@
-/*
- * Copyright (c) 2007 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup devmap
- * @{
- */ 
-
-#ifndef DEVMAP_DEVMAP_H_
-#define DEVMAP_DEVMAP_H_
-
-#include <ipc/ipc.h>
-#include <libadt/list.h>
-
-#define DEVMAP_NAME_MAXLEN 512
-
-typedef enum {
-	DEVMAP_DRIVER_REGISTER = IPC_FIRST_USER_METHOD,
-	DEVMAP_DRIVER_UNREGISTER,
-	DEVMAP_DEVICE_REGISTER,
-	DEVMAP_DEVICE_UNREGISTER,
-	DEVMAP_DEVICE_GET_NAME,
-	DEVMAP_DEVICE_GET_HANDLE
-} devmap_request_t;
-
-/** Representation of device driver.
- * Each driver is responsible for a set of devices.
- */
-typedef struct {
-		/** Pointers to previous and next drivers in linked list */
-	link_t drivers;	
-		/** Pointer to the linked list of devices controlled by
-		 * this driver */
-	link_t devices;
-		/** Phone asociated with this driver */
-	ipcarg_t phone;
-		/** Device driver name */
-	char *name;	
-		/** Futex for list of devices owned by this driver */
-	atomic_t devices_futex;
-} devmap_driver_t;
-
-/** Info about registered device
- *
- */
-typedef struct {
-		/** Pointer to the previous and next device in the list of all devices */
-	link_t devices;
-		/** Pointer to the previous and next device in the list of devices
-		 owned by one driver */
-	link_t driver_devices;
-		/** Unique device identifier  */
-	int handle;
-		/** Device name */
-	char *name;
-		/** Device driver handling this device */
-	devmap_driver_t *driver;
-} devmap_device_t;
-
-/** Interface provided by devmap. 
- * Every process that connects to devmap must ask one of following
- * interfaces otherwise connection will be refused.
- */
-typedef enum {
-		/** Connect as device driver */
-	DEVMAP_DRIVER = 1,	
-		/** Connect as client */
-	DEVMAP_CLIENT,
-		/** Create new connection to instance of device that
-		 * is specified by second argument of call. */
-	DEVMAP_CONNECT_TO_DEVICE
-} devmap_interface_t;
-
-#endif
-
