From 8897faba2d1d2e6802cd066580100685baa46f7f Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Tue, 26 Sep 2023 16:43:33 +0800 Subject: blk: sandbox: Support binding a device with a given logical block size Allow optionally set the logical block size of the host device to bind in the "host bind" command. If not given, defaults to 512. Signed-off-by: Bin Meng --- test/dm/blk.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'test/dm/blk.c') diff --git a/test/dm/blk.c b/test/dm/blk.c index 446c4423e6f..799f1e4dc75 100644 --- a/test/dm/blk.c +++ b/test/dm/blk.c @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -22,8 +23,8 @@ static int dm_test_blk_base(struct unit_test_state *uts) struct udevice *blk0, *blk1, *dev0, *dev1, *dev, *chk0, *chk1; /* Create two, one the parent of the other */ - ut_assertok(host_create_device("test0", false, &dev0)); - ut_assertok(host_create_device("test1", false, &dev1)); + ut_assertok(host_create_device("test0", false, DEFAULT_BLKSZ, &dev0)); + ut_assertok(host_create_device("test1", false, DEFAULT_BLKSZ, &dev1)); /* Check we can find them */ ut_assertok(blk_get_device(UCLASS_HOST, 0, &blk0)); @@ -99,7 +100,7 @@ static int dm_test_blk_find(struct unit_test_state *uts) { struct udevice *blk, *chk, *dev; - ut_assertok(host_create_device("test0", false, &dev)); + ut_assertok(host_create_device("test0", false, DEFAULT_BLKSZ, &dev)); ut_assertok(blk_find_device(UCLASS_HOST, 0, &chk)); ut_assertok(device_find_first_child_by_uclass(dev, UCLASS_BLK, &blk)); -- cgit v1.2.3