On 2026-10-16T07:26:37, Jan Kehren <[email protected]> wrote:
> blk: Add a name-to-interface-type lookup
>
> blk_get_uclass_name() turns an interface type into a name, but there is no
> public way to go the other way. The driver model block layer already has
> the lookup, as a static helper behind blk_get_devnum_by_uclass_idname(),
> which resolves a device at the same time.
>
> A caller that wants to accept an interface name from the user, and only
> resolve a device later, has no way to tell a bad name from a device that
> is not there yet. Export the lookup under a name that mirrors its
> counterpart, and add the legacy block layer equivalent.
>
> Signed-off-by: Jan Kehren <[email protected]>
>
>  drivers/block/blk-uclass.c |  4 ++--
>  drivers/block/blk_legacy.c |  7 +++++++
>  include/blk.h              | 11 +++++++++++
>  3 files changed, 20 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass <[email protected]>

Reply via email to