#include <asm/io.h>
#include <dm/test.h>
#include <dm/root.h>
-#include <dm/ut.h>
#include <dm/uclass-internal.h>
#include <dm/util.h>
+#include <test/ut.h>
DECLARE_GLOBAL_DATA_PTR;
priv->ping_total += DM_TEST_START_TOTAL;
+ /*
+ * If this device is on a bus, the uclass_flag will be set before
+ * calling this function. This is used by
+ * dm_test_bus_child_pre_probe_uclass().
+ */
+ priv->uclass_total += priv->uclass_flag;
+
return 0;
}
.flags = DM_UC_FLAG_SEQ_ALIAS,
};
-int dm_check_devices(struct dm_test_state *dms, int num_devices)
+int dm_check_devices(struct unit_test_state *uts, int num_devices)
{
struct udevice *dev;
int ret;
debug("dev=%d, base=%d: %s\n", i, base,
fdt_get_name(gd->fdt_blob, dev->of_offset, NULL));
- ut_assert(!dm_check_operations(dms, dev, base,
+ ut_assert(!dm_check_operations(uts, dev, base,
dev_get_priv(dev)));
}
}
/* Test that FDT-based binding works correctly */
-static int dm_test_fdt(struct dm_test_state *dms)
+static int dm_test_fdt(struct unit_test_state *uts)
{
const int num_devices = 6;
struct udevice *dev;
ut_assert(dev->platdata);
}
- ut_assertok(dm_check_devices(dms, num_devices));
+ ut_assertok(dm_check_devices(uts, num_devices));
return 0;
}
DM_TEST(dm_test_fdt, 0);
-static int dm_test_fdt_pre_reloc(struct dm_test_state *dms)
+static int dm_test_fdt_pre_reloc(struct unit_test_state *uts)
{
struct uclass *uc;
int ret;
DM_TEST(dm_test_fdt_pre_reloc, 0);
/* Test that sequence numbers are allocated properly */
-static int dm_test_fdt_uclass_seq(struct dm_test_state *dms)
+static int dm_test_fdt_uclass_seq(struct unit_test_state *uts)
{
struct udevice *dev;
DM_TEST(dm_test_fdt_uclass_seq, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
/* Test that we can find a device by device tree offset */
-static int dm_test_fdt_offset(struct dm_test_state *dms)
+static int dm_test_fdt_offset(struct unit_test_state *uts)
{
const void *blob = gd->fdt_blob;
struct udevice *dev;