summaryrefslogtreecommitdiff
path: root/include/dm/device.h
diff options
context:
space:
mode:
authorJean-Jacques Hiblot <jjhiblot@ti.com>2018-08-09 16:17:44 +0200
committerMarek Vasut <marex@denx.de>2018-08-21 16:21:37 +0200
commit7ec9181d6a2b68480a289c36e5729487f2a4add1 (patch)
treea265db6ad852b08e4605bff1df3680d8621b0fd5 /include/dm/device.h
parent999b204383ffb4eee1467604a935ed3a670c460e (diff)
dm: convert device_get_global_by_of_offset() to device_get_global_by_ofnode()
Also add device_find_global_by_ofnode() that also find a device based on the OF node, but doesn't probe the device. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Diffstat (limited to 'include/dm/device.h')
-rw-r--r--include/dm/device.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/include/dm/device.h b/include/dm/device.h
index 49078bc6b36..3120b68fcc6 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -473,18 +473,33 @@ int device_get_child_by_of_offset(struct udevice *parent, int of_offset,
struct udevice **devp);
/**
- * device_get_global_by_of_offset() - Get a device based on FDT offset
+ * device_find_global_by_ofnode() - Get a device based on ofnode
*
- * Locates a device by its device tree offset, searching globally throughout
+ * Locates a device by its device tree ofnode, searching globally throughout
+ * the all driver model devices.
+ *
+ * The device is NOT probed
+ *
+ * @node: Device tree ofnode to find
+ * @devp: Returns pointer to device if found, otherwise this is set to NULL
+ * @return 0 if OK, -ve on error
+ */
+
+int device_find_global_by_ofnode(ofnode node, struct udevice **devp);
+
+/**
+ * device_get_global_by_ofnode() - Get a device based on ofnode
+ *
+ * Locates a device by its device tree ofnode, searching globally throughout
* the all driver model devices.
*
* The device is probed to activate it ready for use.
*
- * @of_offset: Device tree offset to find
+ * @node: Device tree ofnode to find
* @devp: Returns pointer to device if found, otherwise this is set to NULL
* @return 0 if OK, -ve on error
*/
-int device_get_global_by_of_offset(int of_offset, struct udevice **devp);
+int device_get_global_by_ofnode(ofnode node, struct udevice **devp);
/**
* device_find_first_child() - Find the first child of a device