diff options
author | Marek Vasut <marek.vasut+renesas@mailbox.org> | 2023-08-14 01:46:47 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-08-22 15:17:52 -0400 |
commit | 804f7d63f26c00a64e2945fced4841abf200c0c0 (patch) | |
tree | 406cbe7262428e329ec0c4dbb090481316024a6d /disk | |
parent | 30a12e080104dc7cbdead7e9adc4f5ec4f7a3c40 (diff) | |
download | u-boot-804f7d63f26c00a64e2945fced4841abf200c0c0.tar.gz u-boot-804f7d63f26c00a64e2945fced4841abf200c0c0.tar.bz2 u-boot-804f7d63f26c00a64e2945fced4841abf200c0c0.zip |
disk: Move part_create_block_devices() to blk uclass
Move part_create_block_devices() to blk uclass and unexpose
the function. This can now be internal to the block uclass.
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Diffstat (limited to 'disk')
-rw-r--r-- | disk/disk-uclass.c | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/disk/disk-uclass.c b/disk/disk-uclass.c index 90a7c6f0f8..efe4bf1f94 100644 --- a/disk/disk-uclass.c +++ b/disk/disk-uclass.c @@ -55,54 +55,6 @@ static lbaint_t disk_blk_part_offset(struct udevice *dev, lbaint_t start) return start + part->gpt_part_info.start; } -int part_create_block_devices(struct udevice *blk_dev) -{ - int part, count; - struct blk_desc *desc = dev_get_uclass_plat(blk_dev); - struct disk_partition info; - struct disk_part *part_data; - char devname[32]; - struct udevice *dev; - int ret; - - if (!CONFIG_IS_ENABLED(PARTITIONS) || !blk_enabled()) - return 0; - - if (device_get_uclass_id(blk_dev) != UCLASS_BLK) - return 0; - - /* Add devices for each partition */ - for (count = 0, part = 1; part <= MAX_SEARCH_PARTITIONS; part++) { - if (part_get_info(desc, part, &info)) - continue; - snprintf(devname, sizeof(devname), "%s:%d", blk_dev->name, - part); - - ret = device_bind_driver(blk_dev, "blk_partition", - strdup(devname), &dev); - if (ret) - return ret; - - part_data = dev_get_uclass_plat(dev); - part_data->partnum = part; - part_data->gpt_part_info = info; - count++; - - ret = device_probe(dev); - if (ret) { - debug("Can't probe\n"); - count--; - device_unbind(dev); - - continue; - } - } - debug("%s: %d partitions found in %s\n", __func__, count, - blk_dev->name); - - return 0; -} - /* * BLOCK IO APIs */ |