[PATCH 5/6] nv: Use dev_remove_param to delete nv variable
Sascha Hauer
s.hauer at pengutronix.de
Fri Jul 22 03:39:18 PDT 2016
dev_remove_param() is exactly for the purpose of removing a device
parameter, so use this function instead of open coding the
functionality.
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
common/globalvar.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/common/globalvar.c b/common/globalvar.c
index 4110a06..a2eaaa0 100644
--- a/common/globalvar.c
+++ b/common/globalvar.c
@@ -304,13 +304,12 @@ int nvvar_remove(const char *name)
return -ENOENT;
fname = basprintf("/env/nv/%s", p->name);
+
+ dev_remove_param(p);
+
unlink(fname);
free(fname);
- list_del(&p->list);
- free(p->name);
- free(p);
-
return 0;
}
--
2.8.1
More information about the barebox
mailing list