X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;ds=sidebyside;f=common%2Fhwconfig.c;h=daf3eea5f96852bd198be5b4712146cf0916305e;hb=9452b7496f8b85ca3bdda1014495df1a6235a8de;hp=515074808ddada52371ad8329970d005a8d72795;hpb=5aebe3b07254d9ec8f7ae23a4525a6c535a7f858;p=oweals%2Fu-boot.git diff --git a/common/hwconfig.c b/common/hwconfig.c index 515074808d..daf3eea5f9 100644 --- a/common/hwconfig.c +++ b/common/hwconfig.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * An inteface for configuring a hardware via u-boot environment. * @@ -5,18 +6,15 @@ * Copyright 2011 Freescale Semiconductor, Inc. * * Author: Anton Vorontsov - * - * 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 #include #include +#include #include #include +#include #include #include #else @@ -81,10 +79,10 @@ static const char *__hwconfig(const char *opt, size_t *arglen, if (!env_hwconfig) { if (!(gd->flags & GD_FLG_ENV_READY)) { printf("WARNING: Calling __hwconfig without a buffer " - "and before environment is ready\n"); - return NULL; + "and before environment is ready\n"); + return NULL; } - env_hwconfig = getenv("hwconfig"); + env_hwconfig = env_get("hwconfig"); } if (env_hwconfig) { @@ -246,7 +244,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 +275,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);