mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
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>
This commit is contained in:
parent
499fde5c23
commit
d0b4f68d19
3 changed files with 39 additions and 4 deletions
|
@ -142,6 +142,23 @@ int uclass_find_device_by_of_offset(enum uclass_id id, int node,
|
|||
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
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue