From 7ec9181d6a2b68480a289c36e5729487f2a4add1 Mon Sep 17 00:00:00 2001 From: Jean-Jacques Hiblot Date: Thu, 9 Aug 2018 16:17:44 +0200 Subject: 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 --- include/dm/device.h | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'include') 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 -- cgit v1.2.3