[PATCH 04/44] param: implement dev_remove_parameters using param_remove
Ahmad Fatoum
a.fatoum at barebox.org
Mon Aug 11 05:27:44 PDT 2025
Cut down on the duplication by using param_remove.
No functional change.
Signed-off-by: Ahmad Fatoum <a.fatoum at barebox.org>
---
lib/parameter.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/lib/parameter.c b/lib/parameter.c
index b51cee3d0e08..584876bbc24b 100644
--- a/lib/parameter.c
+++ b/lib/parameter.c
@@ -1026,12 +1026,8 @@ void dev_remove_parameters(struct device *dev)
{
struct param_d *p, *n;
- list_for_each_entry_safe(p, n, &dev->parameters, list) {
- p->set(dev, p, NULL);
- list_del(&p->list);
- free_const(p->name);
- free(p);
- }
+ list_for_each_entry_safe(p, n, &dev->parameters, list)
+ param_remove(p);
}
/** @page dev_params Device parameters
--
2.39.5
More information about the barebox
mailing list