dm: blk: Tidy up obtaining a block device from its parent
authorSimon Glass <sjg@chromium.org>
Sun, 30 Oct 2022 01:47:14 +0000 (19:47 -0600)
committerSimon Glass <sjg@chromium.org>
Mon, 7 Nov 2022 23:24:30 +0000 (16:24 -0700)
commit41e751091d7cb1a71ac13ab037e0fcf4fcee67e3
tree45cc31cf54eea520dce5bc5a681ba367bde074d7
parentd1b46595700b063faaec3e33f5754642e68b3d8f
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>
drivers/block/blk-uclass.c
include/blk.h
test/dm/blk.c