]> git.dujemihanovic.xyz Git - u-boot.git/commit
dm: disk: add read/write interfaces with udevice
authorAKASHI Takahiro <takahiro.akashi@linaro.org>
Tue, 19 Apr 2022 01:05:16 +0000 (10:05 +0900)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 23 Apr 2022 20:05:41 +0000 (22:05 +0200)
commit59da9d4782cd9c28d6b679e86596152b54222538
tree623cabeec58683d04439206741fc6279456e51e0
parenta3cb34e9b7506dec1e5f55279f17a12eded86c48
dm: disk: add read/write interfaces with udevice

In include/blk.h, Simon suggested:
===>
/*
 * These functions should take struct udevice instead of struct blk_desc,
 * but this is convenient for migration to driver model. Add a 'd' prefix
 * to the function operations, so that blk_read(), etc. can be reserved for
 * functions with the correct arguments.
 */
unsigned long blk_dread(struct blk_desc *block_dev, lbaint_t start,
                        lbaint_t blkcnt, void *buffer);
unsigned long blk_dwrite(struct blk_desc *block_dev, lbaint_t start,
                         lbaint_t blkcnt, const void *buffer);
unsigned long blk_derase(struct blk_desc *block_dev, lbaint_t start,
                         lbaint_t blkcnt);
<===

So new interfaces are provided with this patch.

They are expected to be used everywhere in U-Boot at the end.
The exceptions are block device drivers, partition drivers and efi_disk
which should know details of blk_desc structure.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
disk/disk-uclass.c
include/part.h