Index: uspace/lib/c/generic/devman.c
===================================================================
--- uspace/lib/c/generic/devman.c	(revision 9934f7d3082d2ffdd107cc0c78d61d504b0f401e)
+++ uspace/lib/c/generic/devman.c	(revision e090244cef809d716b5ae82565ed1b14ad6dca26)
@@ -35,4 +35,5 @@
  */
 
+#include <adt/list.h>
 #include <str.h>
 #include <ipc/services.h>
@@ -231,8 +232,7 @@
 	}
 	
-	link_t *link = match_ids->ids.next;
 	match_id_t *match_id = NULL;
 	
-	while (link != &match_ids->ids) {
+	list_foreach(match_ids->ids, link) {
 		match_id = list_get_instance(link, match_id_t, link);
 		
@@ -255,6 +255,4 @@
 			return retval;
 		}
-		
-		link = link->next;
 	}
 	
