]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dm: core: Switch uclass_foreach_dev_probe to use simple iterator
authorMichal Suchanek <msuchanek@suse.de>
Wed, 12 Oct 2022 19:58:05 +0000 (21:58 +0200)
committerSimon Glass <sjg@chromium.org>
Tue, 18 Oct 2022 03:17:12 +0000 (21:17 -0600)
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
include/dm/uclass.h

index 970182cd904edff627b00115ee059377d48af1cd..95e298d7ddc24d65ca5dbe400f348c497a21471c 100644 (file)
@@ -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;
 }
 
index f6c0110b061806c514f0886e21f5f58e46db53fc..990e9c02d1e99ed7c34e28cc7ff53d7880fb005c 100644 (file)
@@ -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