]> Git Repo - u-boot.git/blobdiff - test/dm/core.c
Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""
[u-boot.git] / test / dm / core.c
index fd4d7569728000645dba206b716b8bb83b5d2bee..7f3f8d183bca4af336e60c32ad380e7d166f9d88 100644 (file)
@@ -512,23 +512,15 @@ static int dm_test_leak(struct unit_test_state *uts)
        int i;
 
        for (i = 0; i < 2; i++) {
-               struct udevice *dev;
                int ret;
-               int id;
 
                dm_leak_check_start(uts);
 
                ut_assertok(dm_scan_plat(false));
                ut_assertok(dm_scan_fdt(false));
 
-               /* Scanning the uclass is enough to probe all the devices */
-               for (id = UCLASS_ROOT; id < UCLASS_COUNT; id++) {
-                       for (ret = uclass_first_device(UCLASS_TEST, &dev);
-                            dev;
-                            ret = uclass_next_device(&dev))
-                               ;
-                       ut_assertok(ret);
-               }
+               ret = uclass_probe_all(UCLASS_TEST);
+               ut_assertok(ret);
 
                ut_assertok(dm_leak_check_end(uts));
        }
@@ -653,10 +645,7 @@ static int dm_test_children(struct unit_test_state *uts)
        ut_asserteq(2 + NODE_COUNT, dm_testdrv_op_count[DM_TEST_OP_PROBE]);
 
        /* Probe everything */
-       for (ret = uclass_first_device(UCLASS_TEST, &dev);
-            dev;
-            ret = uclass_next_device(&dev))
-               ;
+       ret = uclass_probe_all(UCLASS_TEST);
        ut_assertok(ret);
 
        ut_asserteq(total, dm_testdrv_op_count[DM_TEST_OP_PROBE]);
@@ -1089,11 +1078,10 @@ static int dm_test_uclass_devices_get(struct unit_test_state *uts)
        struct udevice *dev;
        int ret;
 
-       for (ret = uclass_first_device(UCLASS_TEST, &dev);
+       for (ret = uclass_first_device_check(UCLASS_TEST, &dev);
             dev;
-            ret = uclass_next_device(&dev)) {
+            ret = uclass_next_device_check(&dev)) {
                ut_assert(!ret);
-               ut_assert(dev);
                ut_assert(device_active(dev));
        }
 
@@ -1123,11 +1111,10 @@ static int dm_test_uclass_devices_get_by_name(struct unit_test_state *uts)
         * this will fail on checking condition: testdev == finddev, since the
         * uclass_get_device_by_name(), returns the first device by given name.
        */
-       for (ret = uclass_first_device(UCLASS_TEST_FDT, &testdev);
+       for (ret = uclass_first_device_check(UCLASS_TEST_FDT, &testdev);
             testdev;
-            ret = uclass_next_device(&testdev)) {
+            ret = uclass_next_device_check(&testdev)) {
                ut_assertok(ret);
-               ut_assert(testdev);
                ut_assert(device_active(testdev));
 
                findret = uclass_get_device_by_name(UCLASS_TEST_FDT,
This page took 0.028517 seconds and 4 git commands to generate.