diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/blk-uclass.c | 12 | ||||
-rw-r--r-- | drivers/block/ide.c | 2 | ||||
-rw-r--r-- | drivers/block/sandbox.c | 2 | ||||
-rw-r--r-- | drivers/mmc/mmc.c | 3 | ||||
-rw-r--r-- | drivers/nvme/nvme.c | 1 | ||||
-rw-r--r-- | drivers/scsi/scsi.c | 1 |
6 files changed, 13 insertions, 8 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), }; diff --git a/drivers/block/ide.c b/drivers/block/ide.c index 38adb6a241..4b8a4eac17 100644 --- a/drivers/block/ide.c +++ b/drivers/block/ide.c @@ -1169,8 +1169,6 @@ static int ide_blk_probe(struct udevice *udev) BLK_REV_SIZE); desc->revision[BLK_REV_SIZE] = '\0'; - part_init(desc); - return 0; } diff --git a/drivers/block/sandbox.c b/drivers/block/sandbox.c index 576d049df7..d3b1aaaba3 100644 --- a/drivers/block/sandbox.c +++ b/drivers/block/sandbox.c @@ -142,7 +142,7 @@ int host_dev_bind(int devnum, char *filename) goto err_file; } - return blk_prepare_device(dev); + return 0; err_file: os_close(fd); err: diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 585951cd78..d6b9cdc992 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -2444,9 +2444,6 @@ static int mmc_startup(struct mmc *mmc) bdesc->product[0] = 0; bdesc->revision[0] = 0; #endif -#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBDISK_SUPPORT) - part_init(bdesc); -#endif return 0; } diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c index eb6fdeda50..1ee0a0aefb 100644 --- a/drivers/nvme/nvme.c +++ b/drivers/nvme/nvme.c @@ -664,7 +664,6 @@ static int nvme_blk_probe(struct udevice *udev) sprintf(desc->vendor, "0x%.4x", pplat->vendor); memcpy(desc->product, ndev->serial, sizeof(ndev->serial)); memcpy(desc->revision, ndev->firmware_rev, sizeof(ndev->firmware_rev)); - part_init(desc); return 0; } diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index bc6ac8cd32..df47e2fc78 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -592,7 +592,6 @@ static int do_scsi_scan_one(struct udevice *dev, int id, int lun, bool verbose) memcpy(&bdesc->vendor, &bd.vendor, sizeof(bd.vendor)); memcpy(&bdesc->product, &bd.product, sizeof(bd.product)); memcpy(&bdesc->revision, &bd.revision, sizeof(bd.revision)); - part_init(bdesc); if (verbose) { printf(" Device %d: ", 0); |