summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-11-18 08:14:30 -0700
committerSimon Glass <sjg@chromium.org>2018-11-29 09:30:05 -0700
commitd0b4f68d199c075f5d734cf184f7eaf1a642083d (patch)
tree4c7b05c7d6d195b98514220b8f59ccc148d940d2 /include
parent499fde5c23921add3cf95fecfe0b03d717d5a33b (diff)
downloadu-boot-d0b4f68d199c075f5d734cf184f7eaf1a642083d.tar.gz
u-boot-d0b4f68d199c075f5d734cf184f7eaf1a642083d.tar.xz
u-boot-d0b4f68d199c075f5d734cf184f7eaf1a642083d.zip
dm: core: Export uclass_find_device_by_phandle()
This function may be useful to code outside of the code driver-model implementation. Export it and add a test. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/dm/uclass-internal.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/dm/uclass-internal.h b/include/dm/uclass-internal.h
index 30d5a4fb9b..8a4839ee88 100644
--- a/include/dm/uclass-internal.h
+++ b/include/dm/uclass-internal.h
@@ -143,6 +143,23 @@ int uclass_find_device_by_ofnode(enum uclass_id id, ofnode node,
struct udevice **devp);
/**
+ * uclass_find_device_by_phandle() - Find a uclass device by phandle
+ *
+ * This searches the devices in the uclass for one with the given phandle.
+ *
+ * The device is NOT probed, it is merely returned.
+ *
+ * @id: ID to look up
+ * @parent: Parent device containing the phandle pointer
+ * @name: Name of property in the parent device node
+ * @devp: Returns pointer to device (there is only one for each node)
+ * @return 0 if OK, -ENOENT if there is no @name present in the node, other
+ * -ve on error
+ */
+int uclass_find_device_by_phandle(enum uclass_id id, struct udevice *parent,
+ const char *name, struct udevice **devp);
+
+/**
* uclass_bind_device() - Associate device with a uclass
*
* Connect the device into uclass's list of devices.