Index: uspace/lib/usbhost/src/endpoint.c
===================================================================
--- uspace/lib/usbhost/src/endpoint.c	(revision 5f97ef445e6e5648a8b8c902eb0f655d579336b4)
+++ uspace/lib/usbhost/src/endpoint.c	(revision e2625b1a1e5a2895b86f0e39c2d70a39e49e042a)
@@ -36,5 +36,4 @@
 
 #include <assert.h>
-#include <atomic.h>
 #include <mem.h>
 #include <stdlib.h>
@@ -60,5 +59,5 @@
 	ep->device = dev;
 
-	atomic_set(&ep->refcnt, 0);
+	refcount_init(&ep->refcnt);
 	fibril_condvar_initialize(&ep->avail);
 
@@ -91,5 +90,5 @@
 void endpoint_add_ref(endpoint_t *ep)
 {
-	atomic_inc(&ep->refcnt);
+	refcount_up(&ep->refcnt);
 }
 
@@ -115,7 +114,6 @@
 void endpoint_del_ref(endpoint_t *ep)
 {
-	if (atomic_predec(&ep->refcnt) == 0) {
+	if (refcount_down(&ep->refcnt))
 		endpoint_destroy(ep);
-	}
 }
 
