X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=test%2Fdm%2Ftest-driver.c;h=d10af5114738cc62f3e077a7b47de5d2c90f58ae;hb=3c5835955aecaacc5abd8af043a7becda009eddb;hp=0f1a37b36e52faabdba5b2a78e28a33852600c4f;hpb=e99f30e105a253ee64bef1ef83b86a47e0d3b6f1;p=u-boot diff --git a/test/dm/test-driver.c b/test/dm/test-driver.c index 0f1a37b36e..d10af51147 100644 --- a/test/dm/test-driver.c +++ b/test/dm/test-driver.c @@ -12,11 +12,11 @@ #include #include #include -#include +#include #include int dm_testdrv_op_count[DM_TEST_OP_COUNT]; -static struct dm_test_state *dms = &global_test_state; +static struct unit_test_state *uts = &global_dm_test_state; static int testdrv_ping(struct udevice *dev, int pingval, int *pingret) { @@ -114,6 +114,8 @@ static int test_manual_bind(struct udevice *dev) static int test_manual_probe(struct udevice *dev) { + struct dm_test_state *dms = uts->priv; + dm_testdrv_op_count[DM_TEST_OP_PROBE]++; if (!dms->force_fail_alloc) dev->priv = calloc(1, sizeof(struct dm_test_priv)); @@ -144,3 +146,14 @@ U_BOOT_DRIVER(test_manual_drv) = { .remove = test_manual_remove, .unbind = test_manual_unbind, }; + +U_BOOT_DRIVER(test_pre_reloc_drv) = { + .name = "test_pre_reloc_drv", + .id = UCLASS_TEST, + .ops = &test_manual_ops, + .bind = test_manual_bind, + .probe = test_manual_probe, + .remove = test_manual_remove, + .unbind = test_manual_unbind, + .flags = DM_FLAG_PRE_RELOC, +};