[PATCH 8/8] disk: Make blk_get_ops() internal to blk uclass

Marek Vasut marek.vasut at mailbox.org
Tue Aug 15 10:24:21 CEST 2023

On 8/15/23 02:31, AKASHI Takahiro wrote:
> On Mon, Aug 14, 2023 at 04:42:57PM -0600, Simon Glass wrote:
>> On Sun, 13 Aug 2023 at 17:47, Marek Vasut
>> <marek.vasut+renesas at mailbox.org> wrote:
>>> Move the macro into blk-uclass.c , since it is only used there.
>>> Signed-off-by: Marek Vasut <marek.vasut+renesas at mailbox.org>
>>> ---
>>> Cc: AKASHI Takahiro <takahiro.akashi at linaro.org>
>>> Cc: Abdellatif El Khlifi <abdellatif.elkhlifi at arm.com>
>>> Cc: Bin Meng <bmeng.cn at gmail.com>
>>> Cc: Heinrich Schuchardt <xypron.glplk at gmx.de>
>>> Cc: Joshua Watt <jpewhacker at gmail.com>
>>> Cc: Michal Suchanek <msuchanek at suse.de>
>>> Cc: Simon Glass <sjg at chromium.org>
>>> Cc: Tobias Waldekranz <tobias at waldekranz.com>
>>> ---
>>>   drivers/block/blk-uclass.c | 2 ++
>>>   include/blk.h              | 2 --
>>>   2 files changed, 2 insertions(+), 2 deletions(-)
>> Reviewed-by: Simon Glass <sjg at chromium.org>
>> Unfortunately this does not stop people using the ops member directly.
>> For this series, I tried a patch myself [1] but I think I stuffed it
>> up. So I will let Takahiro-San figure it out. I would very much like
>> to see this clean-up go in.
> At that time I thought that the necessary change was small and trivial:)
> As for Marek's patch, let me first explain why I implement that way,
> i.e. separating disk_blk_*() from part_disk_*():
> - Initially I tried to implement disk_blk_*() work for both UCLASS_BLOCK
>    and UCLASS_PARTITION, while this idea was rejected by Simon.
> - Then, I implemented part_disk_*() with direct access to the devices,
>    and part_disk_*(), as helper functions, with block caching.

I think the later should not be part_disk_*(), but rather disk_blk_*() ?

>    I thought that this approach was aligned with the implementation of
>    block devices (blk_[read|wirte]).
> If you don't think the second point makes sense, I can agree to Marek's
> approach.

Does it even make sense to have accessors which bypass the block cache ?

Best regards,
Marek Vasut

More information about the U-Boot mailing list