blk: Rewrite if_type to name functions
authorSimon Glass <sjg@chromium.org>
Fri, 12 Aug 2022 01:34:57 +0000 (19:34 -0600)
committerTom Rini <trini@konsulko.com>
Fri, 16 Sep 2022 15:05:16 +0000 (11:05 -0400)
commitbb2c9a30c23752accd53119d3964f6e6d1ae4f32
tree9d80bc33ee8043fa50e6ea0ef8c9233f4ad170f3
parentb8f8f6c8702368a5e6bd6e58556c03d5f8e3f1c7
blk: Rewrite if_type to name functions

These are currently using a simple array lookup in one direction, and
relying on if_type being sequential.

With the move to uclass IDs this needs to change. Update the code to
prepare for the new way. This patch is intended to introduce no
functional change.

The returning of "(none)" from blk_get_if_type_name() is handling a case
that should not happen in either case.

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/block/blk-uclass.c