summaryrefslogtreecommitdiff
path: root/include/dm/uclass-internal.h
diff options
context:
space:
mode:
authorJean-Jacques Hiblot <jjhiblot@ti.com>2018-08-09 16:17:42 +0200
committerMarek Vasut <marex@denx.de>2018-08-21 16:21:37 +0200
commite7c865620e569df493e67d3772673108fce62064 (patch)
tree11a06f4f6941bc79c1caf7e20885772c73a6fa86 /include/dm/uclass-internal.h
parentc3211708cf721163733f03330bdb579d8c0f689b (diff)
downloadu-boot-e7c865620e569df493e67d3772673108fce62064.tar.gz
uclass: Add dev_get_uclass_index() to get the uclass/index of a device
This function is the reciprocal of uclass_find_device(). It will be used to print the index information in dm tree dump. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Diffstat (limited to 'include/dm/uclass-internal.h')
-rw-r--r--include/dm/uclass-internal.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/dm/uclass-internal.h b/include/dm/uclass-internal.h
index 7ba064bd53..30d5a4fb9b 100644
--- a/include/dm/uclass-internal.h
+++ b/include/dm/uclass-internal.h
@@ -24,6 +24,17 @@
int uclass_get_device_tail(struct udevice *dev, int ret, struct udevice **devp);
/**
+ * dev_get_uclass_index() - Get uclass and index of device
+ * @dev: - in - Device that we want the uclass/index of
+ * @ucp: - out - A pointer to the uclass the device belongs to
+ *
+ * The device is not prepared for use - this is an internal function.
+ *
+ * @return the index of the device in the uclass list or -ENODEV if not found.
+ */
+int dev_get_uclass_index(struct udevice *dev, struct uclass **ucp);
+
+/**
* uclass_find_device() - Return n-th child of uclass
* @id: Id number of the uclass
* @index: Position of the child in uclass's list