Index: uspace/srv/devman/dev.c
===================================================================
--- uspace/srv/devman/dev.c	(revision 9b1baac695a63afb1850cd44050a52e06635cbd2)
+++ uspace/srv/devman/dev.c	(revision 8c85f0f28eee89a731d082e5c3e87ae6d4d4ba98)
@@ -48,5 +48,5 @@
 		return NULL;
 
-	atomic_set(&dev->refcnt, 0);
+	refcount_init(&dev->refcnt);
 	list_initialize(&dev->functions);
 	link_initialize(&dev->driver_devices);
@@ -74,5 +74,5 @@
 void dev_add_ref(dev_node_t *dev)
 {
-	atomic_inc(&dev->refcnt);
+	refcount_up(&dev->refcnt);
 }
 
@@ -85,5 +85,5 @@
 void dev_del_ref(dev_node_t *dev)
 {
-	if (atomic_predec(&dev->refcnt) == 0)
+	if (refcount_down(&dev->refcnt))
 		delete_dev_node(dev);
 }
Index: uspace/srv/devman/devman.h
===================================================================
--- uspace/srv/devman/devman.h	(revision 9b1baac695a63afb1850cd44050a52e06635cbd2)
+++ uspace/srv/devman/devman.h	(revision 8c85f0f28eee89a731d082e5c3e87ae6d4d4ba98)
@@ -41,5 +41,5 @@
 #include <ipc/loc.h>
 #include <fibril_synch.h>
-#include <atomic.h>
+#include <refcount.h>
 #include <async.h>
 
@@ -115,5 +115,5 @@
 struct dev_node {
 	/** Reference count */
-	atomic_t refcnt;
+	atomic_refcount_t refcnt;
 
 	/** The global unique identifier of the device. */
@@ -155,5 +155,5 @@
 struct fun_node {
 	/** Reference count */
-	atomic_t refcnt;
+	atomic_refcount_t refcnt;
 	/** State */
 	fun_state_t state;
Index: uspace/srv/devman/driver.c
===================================================================
--- uspace/srv/devman/driver.c	(revision 9b1baac695a63afb1850cd44050a52e06635cbd2)
+++ uspace/srv/devman/driver.c	(revision 8c85f0f28eee89a731d082e5c3e87ae6d4d4ba98)
@@ -406,6 +406,4 @@
 		}
 
-		log_msg(LOG_DEFAULT, LVL_DEBUG, "pass_devices_to_driver: dev->refcnt=%d\n",
-		    (int)atomic_get(&dev->refcnt));
 		dev_add_ref(dev);
 
Index: uspace/srv/devman/fun.c
===================================================================
--- uspace/srv/devman/fun.c	(revision 9b1baac695a63afb1850cd44050a52e06635cbd2)
+++ uspace/srv/devman/fun.c	(revision 8c85f0f28eee89a731d082e5c3e87ae6d4d4ba98)
@@ -60,5 +60,5 @@
 
 	fun->state = FUN_INIT;
-	atomic_set(&fun->refcnt, 0);
+	refcount_init(&fun->refcnt);
 	fibril_mutex_initialize(&fun->busy_lock);
 	link_initialize(&fun->dev_functions);
@@ -89,5 +89,5 @@
 void fun_add_ref(fun_node_t *fun)
 {
-	atomic_inc(&fun->refcnt);
+	refcount_up(&fun->refcnt);
 }
 
@@ -100,5 +100,5 @@
 void fun_del_ref(fun_node_t *fun)
 {
-	if (atomic_predec(&fun->refcnt) == 0)
+	if (refcount_down(&fun->refcnt))
 		delete_fun_node(fun);
 }
