[PATCH 1/3] nvvar: Simplify by using nv_set()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 common/globalvar.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/common/globalvar.c b/common/globalvar.c
index 75e4d43..decd73c 100644
--- a/common/globalvar.c
+++ b/common/globalvar.c
@@ -124,19 +124,10 @@ int nvvar_add(const char *name, const char *value)
 	if (IS_ERR(p))
 		return PTR_ERR(p);
 
-	if (value) {
-		ret = dev_set_param(&global_device, name, value);
-		if (ret)
-			return ret;
-	} else {
+	if (!value)
 		value = dev_get_param(&global_device, name);
-		if (!value)
-			value = "";
-	}
-
-	p->value = xstrdup(value);
 
-	return nv_save(p->name, value);
+	return nv_set(&nv_device, p, value);
 }
 
 int nvvar_remove(const char *name)
-- 
2.8.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux