summaryrefslogtreecommitdiff
path: root/include/blk.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-04-24 23:31:03 -0600
committerTom Rini <trini@konsulko.com>2022-04-25 10:00:03 -0400
commit87571b7f2077c567f8d050abe60ff5578f0b7cd8 (patch)
tree7a8de897ea1993c5d38117776ef9b8a72550b947 /include/blk.h
parent026e2136f834feb19acc95efd61e6613f37234de (diff)
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 'include/blk.h')
-rw-r--r--include/blk.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/blk.h b/include/blk.h
index dbe9ae219d..9503369db8 100644
--- a/include/blk.h
+++ b/include/blk.h
@@ -434,6 +434,14 @@ int blk_select_hwpart(struct udevice *dev, int hwpart);
int blk_get_from_parent(struct udevice *parent, struct udevice **devp);
/**
+ * blk_get_devtype() - Get the device type of a block device
+ *
+ * @dev: Block device to check
+ * Return: device tree, i.e. the uclass name of its parent, e.g. "mmc"
+ */
+const char *blk_get_devtype(struct udevice *dev);
+
+/**
* blk_get_by_device() - Get the block device descriptor for the given device
* @dev: Instance of a storage device
*