]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
dm: core: remove unnecessary return condition in uclass lookup
authorMasahiro Yamada <yamada.m@jp.panasonic.com>
Mon, 17 Nov 2014 08:19:41 +0000 (17:19 +0900)
committerSimon Glass <sjg@chromium.org>
Sat, 22 Nov 2014 09:16:49 +0000 (10:16 +0100)
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: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
drivers/core/lists.c

index 058f2780a3732a8c661359a9bbf0a03691be05f7..ff115c4723e7135986daced0f08dede34379838f 100644 (file)
@@ -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);
        struct uclass_driver *entry;
 
-       if ((id == UCLASS_INVALID) || !uclass)
-               return NULL;
-
        for (entry = uclass; entry != uclass + n_ents; entry++) {
                if (entry->id == id)
                        return entry;