diff options
author | Simon Glass <sjg@chromium.org> | 2017-07-29 11:34:53 -0600 |
---|---|---|
committer | Jaehoon Chung <jh80.chung@samsung.com> | 2017-08-17 16:44:16 +0900 |
commit | 6faa4ed74df2d83cbb959ba799032da4249893b6 (patch) | |
tree | a79d028afa2b58447d49c6e70497530e0138779a /drivers/block/blk-uclass.c | |
parent | 745fb9c25e9fd4c59e375cf8f6e2eb8ff75d6d95 (diff) | |
download | u-boot-6faa4ed74df2d83cbb959ba799032da4249893b6.zip u-boot-6faa4ed74df2d83cbb959ba799032da4249893b6.tar.gz u-boot-6faa4ed74df2d83cbb959ba799032da4249893b6.tar.bz2 |
dm: blk: Add a function to find an interface-type name
Add a function to find the name of an interface type (e.g. "sata", "scsi")
from the interface type enum.
This is useful for generic code (not specific to SATA or SCSI, for
example) that wants to display the type of interface it is dealing with.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/block/blk-uclass.c')
-rw-r--r-- | drivers/block/blk-uclass.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c index a3737ba..3adb92b 100644 --- a/drivers/block/blk-uclass.c +++ b/drivers/block/blk-uclass.c @@ -57,6 +57,11 @@ static enum uclass_id if_type_to_uclass_id(enum if_type if_type) return if_type_uclass_id[if_type]; } +const char *blk_get_if_type_name(enum if_type if_type) +{ + return if_typename_str[if_type]; +} + struct blk_desc *blk_get_devnum_by_type(enum if_type if_type, int devnum) { struct blk_desc *desc; |