Skip to content
Snippets Groups Projects
Commit 17b28edb authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Simon Glass
Browse files

dm: core: remove unnecessary return condition in uclass lookup


These conditions never happen.
 - There is no real uclass with UCLASS_INVALID id.
 - uclass never becomes NULL because ll_entry_start() always returns
   a valid pointer.

Signed-off-by: default avatarMasahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: default avatarSimon Glass <sjg@chromium.org>
parent f724e0bb
No related branches found
No related tags found
No related merge requests found
...@@ -41,9 +41,6 @@ struct uclass_driver *lists_uclass_lookup(enum uclass_id id) ...@@ -41,9 +41,6 @@ struct uclass_driver *lists_uclass_lookup(enum uclass_id id)
const int n_ents = ll_entry_count(struct uclass_driver, uclass); const int n_ents = ll_entry_count(struct uclass_driver, uclass);
struct uclass_driver *entry; struct uclass_driver *entry;
if ((id == UCLASS_INVALID) || !uclass)
return NULL;
for (entry = uclass; entry != uclass + n_ents; entry++) { for (entry = uclass; entry != uclass + n_ents; entry++) {
if (entry->id == id) if (entry->id == id)
return entry; return entry;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment