9
0
Fork 0

nv: Use dev_remove_param to delete nv variable

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@pengutronix.de>
This commit is contained in:
Sascha Hauer 2016-07-19 08:09:20 +02:00
parent 0c2fccceb6
commit 75926bc33d
1 changed files with 3 additions and 4 deletions

View File

@ -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;
}