mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-01 08:59:33 +00:00
disk: Drop always true conditional check
if (device_get_uclass_id(dev) == UCLASS_PARTITION) is always true, because this disk_blk_read() function calls dev_get_blk() above and checks its return value for non-NULL. The dev_get_blk() performs the same device_get_uclass_id(dev) check and returns NULL if not UCLASS_PARTITION. Drop the duplicate check. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
This commit is contained in:
parent
5ebe790ff0
commit
5ff4609f85
1 changed files with 2 additions and 4 deletions
|
@ -186,10 +186,8 @@ unsigned long disk_blk_read(struct udevice *dev, lbaint_t start,
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
|
|
||||||
start_in_disk = start;
|
start_in_disk = start;
|
||||||
if (device_get_uclass_id(dev) == UCLASS_PARTITION) {
|
|
||||||
part = dev_get_uclass_plat(dev);
|
part = dev_get_uclass_plat(dev);
|
||||||
start_in_disk += part->gpt_part_info.start;
|
start_in_disk += part->gpt_part_info.start;
|
||||||
}
|
|
||||||
|
|
||||||
if (blkcache_read(desc->uclass_id, desc->devnum, start_in_disk, blkcnt,
|
if (blkcache_read(desc->uclass_id, desc->devnum, start_in_disk, blkcnt,
|
||||||
desc->blksz, buffer))
|
desc->blksz, buffer))
|
||||||
|
|
Loading…
Reference in a new issue