diff options
author | Simon Glass <sjg@chromium.org> | 2022-04-24 23:31:03 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-04-25 10:00:03 -0400 |
commit | 87571b7f2077c567f8d050abe60ff5578f0b7cd8 (patch) | |
tree | 7a8de897ea1993c5d38117776ef9b8a72550b947 /drivers/block | |
parent | 026e2136f834feb19acc95efd61e6613f37234de (diff) | |
download | u-boot-87571b7f2077c567f8d050abe60ff5578f0b7cd8.zip u-boot-87571b7f2077c567f8d050abe60ff5578f0b7cd8.tar.gz u-boot-87571b7f2077c567f8d050abe60ff5578f0b7cd8.tar.bz2 |
dm: blk: Add a function to return the device type
Use the uclass name to get the device type for a block device.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/blk-uclass.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c index f1e4a85..29f355f 100644 --- a/drivers/block/blk-uclass.c +++ b/drivers/block/blk-uclass.c @@ -509,6 +509,13 @@ int blk_get_from_parent(struct udevice *parent, struct udevice **devp) return 0; } +const char *blk_get_devtype(struct udevice *dev) +{ + struct udevice *parent = dev_get_parent(dev); + + return uclass_get_name(device_get_uclass_id(parent)); +}; + int blk_find_max_devnum(enum if_type if_type) { struct udevice *dev; |