]> git.sur5r.net Git - u-boot/blobdiff - common/hwconfig.c
test/py: Make print statements python 3.x safe
[u-boot] / common / hwconfig.c
index e47d4d742066eb2b221833293c8057208c3dfb9b..e9e956a3223a098386ff6f47d9049da89f44fdf6 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * An inteface for configuring a hardware via u-boot environment.
  *
@@ -5,11 +6,6 @@
  * Copyright 2011 Freescale Semiconductor, Inc.
  *
  * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
  */
 
 #ifndef HWCONFIG_TEST
@@ -84,7 +80,7 @@ static const char *__hwconfig(const char *opt, size_t *arglen,
                                        "and before environment is ready\n");
                        return NULL;
                }
-               env_hwconfig = getenv("hwconfig");
+               env_hwconfig = env_get("hwconfig");
        }
 
        if (env_hwconfig) {
@@ -246,7 +242,7 @@ int main()
        const char *ret;
        size_t len;
 
-       setenv("hwconfig", "key1:subkey1=value1,subkey2=value2;key2:value3;;;;"
+       env_set("hwconfig", "key1:subkey1=value1,subkey2=value2;key2:value3;;;;"
                           "key3;:,:=;key4", 1);
 
        ret = hwconfig_arg("key1", &len);
@@ -277,7 +273,7 @@ int main()
        assert(hwconfig_arg("key4", &len) == NULL);
        assert(hwconfig_arg("bogus", &len) == NULL);
 
-       unsetenv("hwconfig");
+       unenv_set("hwconfig");
 
        assert(hwconfig(NULL) == 0);
        assert(hwconfig("") == 0);