]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dm: blk: add a device-probe hook for scanning disk partitions
authorAKASHI Takahiro <takahiro.akashi@linaro.org>
Tue, 19 Apr 2022 01:05:10 +0000 (10:05 +0900)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 23 Apr 2022 20:05:41 +0000 (22:05 +0200)
Now that all the block device drivers have enable a probe hook, we will
call part_create_block_devices() to enumerate all the partitions and
create associated udevices when a block device is detected.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/block/blk-uclass.c

index f1e4a8564679e1c94d81ea7efcccf6ba0548693d..791e26c06ebef463fd5790afa9a04ca071edd064 100644 (file)
@@ -741,6 +741,10 @@ static int blk_post_probe(struct udevice *dev)
                struct blk_desc *desc = dev_get_uclass_plat(dev);
 
                part_init(desc);
+
+               if (desc->part_type != PART_TYPE_UNKNOWN &&
+                   part_create_block_devices(dev))
+                       debug("*** creating partitions failed\n");
        }
 
        return 0;