]> git.karo-electronics.de Git - karo-tx-uboot.git/commit
dm: core: uclass: add function: uclass_get_device_by_name()
authorPrzemyslaw Marczak <p.marczak@samsung.com>
Wed, 15 Apr 2015 11:07:23 +0000 (13:07 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 8 Sep 2015 20:30:10 +0000 (22:30 +0200)
commitd1efb365332d73780545882d8847e21eac1c3b66
treea160d11a9974e537066ad7839eeaa40b51725470
parentd6122214fa165272fcb52ae28a338f952b810059
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: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
drivers/core/uclass.c
include/dm/uclass.h