]> git.dujemihanovic.xyz Git - u-boot.git/commit
disk: Simplify disk_blk_read() using blk_read()
authorMarek Vasut <marek.vasut+renesas@mailbox.org>
Sun, 13 Aug 2023 23:46:42 +0000 (01:46 +0200)
committerTom Rini <trini@konsulko.com>
Tue, 22 Aug 2023 19:17:52 +0000 (15:17 -0400)
commit91d3066c907dedb3d45fd16e11f938bf46eafec7
treeb858d4246c9360f09ad754dc6743145ade799513
parent5ff4609f855b9851af572f0ba9b66e8a5837fd8c
disk: Simplify disk_blk_read() using blk_read()

The disk_blk_read() can be simplified using blk_read(), the only
things which needs to be handled are the read offset based on the
partition properties, and the block device ops which are coming
from the parent udevice, not the partition udevice.

The later is currently not implemented correctly as far as I can
tell, since the current code extracts block device descriptor from
the parent udevice which is OK, but extracts block device operations
from the partition udevice, which does not seem OK.

Switching to the blk_read() fixes that too.

The dev_get_blk() usage is simplified using UCLASS_PARTITION check.

Add non-confusing documentation what this really does.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
disk/disk-uclass.c