diff mbox series

[RFC,v2,14/20] dm: blk: add a device-probe hook for scanning disk partitions

Message ID 20211210064947.73361-15-takahiro.akashi@linaro.org
State Superseded
Headers show
Series efi_loader: more tightly integrate UEFI disks to driver model | expand

Commit Message

AKASHI Takahiro Dec. 10, 2021, 6:49 a.m. UTC
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>
---
 drivers/block/blk-uclass.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Simon Glass Dec. 13, 2021, 12:51 p.m. UTC | #1
On Thu, 9 Dec 2021 at 23:59, AKASHI Takahiro <takahiro.akashi@linaro.org> wrote:
>
> 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>
> ---
>  drivers/block/blk-uclass.c | 4 ++++
>  1 file changed, 4 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c
index f7ad90e8890f..90687189e6d3 100644
--- a/drivers/block/blk-uclass.c
+++ b/drivers/block/blk-uclass.c
@@ -715,6 +715,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;