Index: uspace/srv/devman/drv_conn.c
===================================================================
--- uspace/srv/devman/drv_conn.c	(revision 61eb2ce2769cc7e957b2ee93ca59919d895a7999)
+++ uspace/srv/devman/drv_conn.c	(revision 4a3a5a0bef135a6de53fbdafff893157b3296753)
@@ -1,3 +1,4 @@
 /*
+ * Copyright (c) 2023 Jiri Svoboda
  * Copyright (c) 2010 Lenka Trochtova
  * All rights reserved.
@@ -360,5 +361,5 @@
 	rc = loc_category_get_id(cat_name, &cat_id, IPC_FLAG_BLOCKING);
 	if (rc == EOK)
-		rc = loc_service_add_to_cat(fun->service_id, cat_id);
+		rc = loc_service_add_to_cat(devman_srv, fun->service_id, cat_id);
 	if (rc == EOK) {
 		log_msg(LOG_DEFAULT, LVL_NOTE, "Function `%s' added to category `%s'.",
Index: uspace/srv/devman/loc.c
===================================================================
--- uspace/srv/devman/loc.c	(revision 61eb2ce2769cc7e957b2ee93ca59919d895a7999)
+++ uspace/srv/devman/loc.c	(revision 4a3a5a0bef135a6de53fbdafff893157b3296753)
@@ -1,3 +1,4 @@
 /*
+ * Copyright (c) 2023 Jiri Svoboda
  * Copyright (c) 2010 Lenka Trochtova
  * All rights reserved.
@@ -37,4 +38,5 @@
 #include "fun.h"
 #include "loc.h"
+#include "main.h"
 
 /** Create loc path and name for the function. */
@@ -59,5 +61,5 @@
 	}
 
-	loc_service_register(loc_pathname, &fun->service_id);
+	loc_service_register(devman_srv, loc_pathname, &fun->service_id);
 
 	tree_add_loc_function(tree, fun);
@@ -69,5 +71,5 @@
 errno_t loc_unregister_tree_function(fun_node_t *fun, dev_tree_t *tree)
 {
-	errno_t rc = loc_service_unregister(fun->service_id);
+	errno_t rc = loc_service_unregister(devman_srv, fun->service_id);
 	tree_rem_loc_function(tree, fun);
 	return rc;
Index: uspace/srv/devman/main.c
===================================================================
--- uspace/srv/devman/main.c	(revision 61eb2ce2769cc7e957b2ee93ca59919d895a7999)
+++ uspace/srv/devman/main.c	(revision 4a3a5a0bef135a6de53fbdafff893157b3296753)
@@ -1,3 +1,4 @@
 /*
+ * Copyright (c) 2023 Jiri Svoboda
  * Copyright (c) 2010 Lenka Trochtova
  * All rights reserved.
@@ -64,4 +65,5 @@
 driver_list_t drivers_list;
 dev_tree_t device_tree;
+loc_srv_t *devman_srv;
 
 static void devman_connection_device(ipc_call_t *icall, void *arg)
@@ -280,4 +282,6 @@
 static bool devman_init(void)
 {
+	errno_t rc;
+
 	log_msg(LOG_DEFAULT, LVL_DEBUG, "devman_init - looking for available drivers.");
 
@@ -305,5 +309,9 @@
 	 * not work.
 	 */
-	loc_server_register(NAME);
+	rc = loc_server_register(NAME, &devman_srv);
+	if (rc != EOK) {
+		log_msg(LOG_DEFAULT, LVL_FATAL, "Error registering devman server.");
+		return false;
+	}
 
 	return true;
Index: uspace/srv/devman/main.h
===================================================================
--- uspace/srv/devman/main.h	(revision 61eb2ce2769cc7e957b2ee93ca59919d895a7999)
+++ uspace/srv/devman/main.h	(revision 4a3a5a0bef135a6de53fbdafff893157b3296753)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2013 Jiri Svoboda
+ * Copyright (c) 2023 Jiri Svoboda
  * All rights reserved.
  *
@@ -34,8 +34,10 @@
 #define MAIN_H_
 
+#include <loc.h>
 #include "devman.h"
 
 extern driver_list_t drivers_list;
 extern dev_tree_t device_tree;
+extern loc_srv_t *devman_srv;
 
 #endif
