Skip to content
Snippets Groups Projects
Commit b7af1a2d authored by Przemyslaw Marczak's avatar Przemyslaw Marczak Committed by Simon Glass
Browse files

dm: core: uclass: add function: uclass_get_device_by_name()


This commit extends the driver model uclass's API by function:
- uclass_get_device_by_name()

And this function returns the device if:
- uclass with given ID, exists,
- device with exactly given name(dev->name), exists,
- device probe, doesn't return an error.

The returned device is activated and ready to use.

Note:
This function returns the first device, which name is equal
to the given one. This means, that using this function you must
assume, that the device name is unique in the given uclass's ID
device list.

Signed-off-by: default avatarPrzemyslaw Marczak <p.marczak@samsung.com>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: default avatarSimon Glass <sjg@chromium.org>
parent e0735a4c
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment