summaryrefslogtreecommitdiff
path: root/include/dm
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-10-05 20:42:13 -0600
committerBin Meng <bmeng.cn@gmail.com>2016-10-11 11:55:33 +0800
commit0a5f6f869f1c2c6e9f75d83203754937014cbe47 (patch)
tree998b48a943323c397a2c1b856672b77841858039 /include/dm
parent5023bd7a804e09d0bf4937d8fecb5d85af6dba3c (diff)
downloadu-boot-imx-0a5f6f869f1c2c6e9f75d83203754937014cbe47.zip
u-boot-imx-0a5f6f869f1c2c6e9f75d83203754937014cbe47.tar.gz
u-boot-imx-0a5f6f869f1c2c6e9f75d83203754937014cbe47.tar.bz2
dm: core: Add a function to get a uclass name
It is useful in debug() statements to display the name of the uclass for a device. Add a simple function to provide this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'include/dm')
-rw-r--r--include/dm/uclass.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/dm/uclass.h b/include/dm/uclass.h
index 84f05bc..b583aa8 100644
--- a/include/dm/uclass.h
+++ b/include/dm/uclass.h
@@ -119,6 +119,14 @@ struct uclass_driver {
int uclass_get(enum uclass_id key, struct uclass **ucp);
/**
+ * uclass_get_name() - Get the name of a uclass driver
+ *
+ * @id: ID to look up
+ * @returns the name of the uclass driver for that ID, or NULL if none
+ */
+const char *uclass_get_name(enum uclass_id id);
+
+/**
* uclass_get_device() - Get a uclass device based on an ID and index
*
* The device is probed to activate it ready for use.