From 801f71194c54c75e90d723b9be3434b6354fce71 Mon Sep 17 00:00:00 2001
From: Michal Suchanek <msuchanek@suse.de>
Date: Wed, 12 Oct 2022 21:58:05 +0200
Subject: [PATCH] dm: core: Switch uclass_foreach_dev_probe to use simple
 iterator

The return value is not used for anythig, and in a later patch the
behavior of the _err iterator will change in an incompatible way.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Update pvblock_probe() to avoid using internal var:
Signed-off-by: Simon Glass <sjg@chromium.org>
---
 drivers/xen/pvblock.c | 5 +----
 include/dm/uclass.h   | 4 ++--
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/xen/pvblock.c b/drivers/xen/pvblock.c
index 970182cd90..95e298d7dd 100644
--- a/drivers/xen/pvblock.c
+++ b/drivers/xen/pvblock.c
@@ -852,10 +852,7 @@ static int pvblock_probe(struct udevice *udev)
 	ret = uclass_get(UCLASS_BLK, &uc);
 	if (ret)
 		return ret;
-	uclass_foreach_dev_probe(UCLASS_BLK, udev) {
-		if (_ret)
-			return _ret;
-	};
+	uclass_foreach_dev_probe(UCLASS_BLK, udev);
 	return 0;
 }
 
diff --git a/include/dm/uclass.h b/include/dm/uclass.h
index f6c0110b06..990e9c02d1 100644
--- a/include/dm/uclass.h
+++ b/include/dm/uclass.h
@@ -491,7 +491,7 @@ int uclass_id_count(enum uclass_id id);
  * are no more devices.
  */
 #define uclass_foreach_dev_probe(id, dev)	\
-	for (int _ret = uclass_first_device_err(id, &dev); !_ret && dev; \
-	     _ret = uclass_next_device_err(&dev))
+	for (uclass_first_device(id, &dev); dev; \
+	     uclass_next_device(&dev))
 
 #endif
-- 
2.39.5