Merge branch 'master' of git://www.denx.de/git/u-boot-socfpga
[oweals/u-boot.git] / test / dm / test-uclass.c
index be91657347b0df53514ee1ce29718127864f6100..4ae75ef7640c4382958805c31657f3c43850c6e4 100644 (file)
@@ -30,7 +30,17 @@ int test_ping(struct udevice *dev, int pingval, int *pingret)
 
 static int test_post_bind(struct udevice *dev)
 {
+       struct dm_test_perdev_uc_pdata *uc_pdata;
+
        dm_testdrv_op_count[DM_TEST_OP_POST_BIND]++;
+       ut_assert(!device_active(dev));
+
+       uc_pdata = dev_get_uclass_platdata(dev);
+       ut_assert(uc_pdata);
+
+       uc_pdata->intval1 = TEST_UC_PDATA_INTVAL1;
+       uc_pdata->intval2 = TEST_UC_PDATA_INTVAL2;
+       uc_pdata->intval3 = TEST_UC_PDATA_INTVAL3;
 
        return 0;
 }
@@ -48,7 +58,7 @@ static int test_pre_probe(struct udevice *dev)
 
        dm_testdrv_op_count[DM_TEST_OP_PRE_PROBE]++;
        ut_assert(priv);
-       ut_assert(!device_active(dev));
+       ut_assert(device_active(dev));
 
        return 0;
 }
@@ -114,4 +124,6 @@ UCLASS_DRIVER(test) = {
        .destroy        = test_destroy,
        .priv_auto_alloc_size   = sizeof(struct dm_test_uclass_priv),
        .per_device_auto_alloc_size = sizeof(struct dm_test_uclass_perdev_priv),
+       .per_device_platdata_auto_alloc_size =
+                                       sizeof(struct dm_test_perdev_uc_pdata),
 };