diff options
author | Tom Rini <trini@konsulko.com> | 2018-02-04 16:30:31 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-02-04 16:30:31 +0300 |
commit | 211a3a23b92798e870b85262ef07265845813a6c (patch) | |
tree | 4644a36131351691d98a6c0a60c303106122bce9 /drivers | |
parent | ab1af91093e3a5e3e86b77ebaf568facd386a1df (diff) | |
parent | 1973b381a1b3545783c3238080f566746579e923 (diff) | |
download | u-boot-211a3a23b92798e870b85262ef07265845813a6c.tar.xz |
Merge git://git.denx.de/u-boot-dm
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/core/uclass.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c index f5e4067922..1aedaa08f0 100644 --- a/drivers/core/uclass.c +++ b/drivers/core/uclass.c @@ -158,6 +158,20 @@ const char *uclass_get_name(enum uclass_id id) return uc->uc_drv->name; } +enum uclass_id uclass_get_by_name(const char *name) +{ + int i; + + for (i = 0; i < UCLASS_COUNT; i++) { + struct uclass_driver *uc_drv = lists_uclass_lookup(i); + + if (uc_drv && !strcmp(uc_drv->name, name)) + return i; + } + + return UCLASS_INVALID; +} + int uclass_find_device(enum uclass_id id, int index, struct udevice **devp) { struct uclass *uc; |