summaryrefslogtreecommitdiff
path: root/test/dm
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-10-29 19:47:14 -0600
committerSimon Glass <sjg@chromium.org>2022-11-07 16:24:30 -0700
commit41e751091d7cb1a71ac13ab037e0fcf4fcee67e3 (patch)
tree45cc31cf54eea520dce5bc5a681ba367bde074d7 /test/dm
parentd1b46595700b063faaec3e33f5754642e68b3d8f (diff)
dm: blk: Tidy up obtaining a block device from its parent
This function now finds its block-device child by looking for a child device of the correct uclass (UCLASS_BLK). It cannot produce a device of any other type, so drop the superfluous check. Provide a version which does not probe the device, since that is often needed when setting up the device's platdata. Also fix up the function's comment. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/dm')
-rw-r--r--test/dm/blk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/dm/blk.c b/test/dm/blk.c
index 35bd5318f0b..6f0cb98c861 100644
--- a/test/dm/blk.c
+++ b/test/dm/blk.c
@@ -160,7 +160,7 @@ static int dm_test_blk_get_from_parent(struct unit_test_state *uts)
ut_assertok(blk_get_from_parent(dev, &blk));
ut_assertok(uclass_get_device(UCLASS_I2C, 0, &dev));
- ut_asserteq(-ENOTBLK, blk_get_from_parent(dev, &blk));
+ ut_asserteq(-ENODEV, blk_get_from_parent(dev, &blk));
ut_assertok(uclass_get_device(UCLASS_GPIO, 0, &dev));
ut_asserteq(-ENODEV, blk_get_from_parent(dev, &blk));