]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
env: Fix return values in env_attr_lookup()
authorJoe Hershberger <joe.hershberger@ni.com>
Wed, 20 May 2015 19:27:17 +0000 (14:27 -0500)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 8 Sep 2015 20:43:16 +0000 (22:43 +0200)
This function returned numbers for error codes. Change them to error
codes.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
common/env_attr.c

index 64baca5a10a7e65df63fd7d4f7b097fa23f4be12..e791f442002c5c0d37987c840ce3dd63257802e5 100644 (file)
@@ -148,10 +148,10 @@ int env_attr_lookup(const char *attr_list, const char *name, char *attributes)
 
        if (!attributes)
                /* bad parameter */
-               return -1;
+               return -EINVAL;
        if (!attr_list)
                /* list not found */
-               return 1;
+               return -EINVAL;
 
        entry = reverse_strstr(attr_list, name, NULL);
        while (entry != NULL) {
@@ -209,5 +209,5 @@ int env_attr_lookup(const char *attr_list, const char *name, char *attributes)
        }
 
        /* not found in list */
-       return 2;
+       return -ENOENT;
 }