diff options
Diffstat (limited to 'drivers/block/blk-uclass.c')
-rw-r--r-- | drivers/block/blk-uclass.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c index facf52711c..95e7b540a5 100644 --- a/drivers/block/blk-uclass.c +++ b/drivers/block/blk-uclass.c @@ -644,8 +644,20 @@ int blk_unbind_all(int if_type) return 0; } +static int blk_post_probe(struct udevice *dev) +{ +#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBDISK_SUPPORT) + struct blk_desc *desc = dev_get_uclass_platdata(dev); + + part_init(desc); +#endif + + return 0; +} + UCLASS_DRIVER(blk) = { .id = UCLASS_BLK, .name = "blk", + .post_probe = blk_post_probe, .per_device_platdata_auto_alloc_size = sizeof(struct blk_desc), }; |