dm: simplify uclass_foreach_dev() implementation
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Mon, 10 Aug 2015 16:09:43 +0000 (01:09 +0900)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 10 Sep 2015 10:19:15 +0000 (12:19 +0200)
This can be simply written with list_for_each_entry(), maybe
this macro was not necessary in the first place.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>
include/dm/uclass.h

index d56877c..d214b88 100644 (file)
@@ -240,12 +240,7 @@ int uclass_resolve_seq(struct udevice *dev);
  * are no more devices.
  * @uc: uclass to scan
  */
-#define uclass_foreach_dev(pos, uc)                                    \
-       for (pos = list_entry((&(uc)->dev_head)->next, typeof(*pos),    \
-                       uclass_node);                                   \
-            prefetch(pos->uclass_node.next),                           \
-                       &pos->uclass_node != (&(uc)->dev_head);         \
-            pos = list_entry(pos->uclass_node.next, typeof(*pos),      \
-                       uclass_node))
+#define uclass_foreach_dev(pos, uc)    \
+       list_for_each_entry(pos, &uc->dev_head, uclass_node)
 
 #endif