diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-11-16 14:01:34 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-11-16 14:01:34 +0100 |
commit | 856f60dbd157126241cf9033514137849bb5ca22 (patch) | |
tree | fca1784ef63b89a78127a0f4d1340f90eedd6848 /lib | |
parent | ec78bea331e195fff267ae949cee4777ef1add56 (diff) | |
parent | f4ca20c4d27751ee749f382cfd4949d825534fce (diff) | |
download | barebox-856f60dbd157126241cf9033514137849bb5ca22.tar.gz barebox-856f60dbd157126241cf9033514137849bb5ca22.tar.xz |
Merge branch 'for-next/misc'
Conflicts:
commands/Makefile
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/parameter.c | 18 | ||||
-rw-r--r-- | lib/show_progress.c | 3 |
2 files changed, 20 insertions, 1 deletions
diff --git a/lib/parameter.c b/lib/parameter.c index b33ad1745..c00b82438 100644 --- a/lib/parameter.c +++ b/lib/parameter.c @@ -213,6 +213,24 @@ int dev_add_param_fixed(struct device_d *dev, char *name, char *value) } /** + * dev_remove_param - remove a parameter from a device and free its + * memory + * @param dev The device + * @param name The name of the parameter + */ +void dev_remove_param(struct device_d *dev, char *name) +{ + struct param_d *p = get_param_by_name(dev, name); + + if (p) { + p->set(dev, p, NULL); + list_del(&p->list); + free(p->name); + free(p); + } +} + +/** * dev_remove_parameters - remove all parameters from a device and free their * memory * @param dev The device diff --git a/lib/show_progress.c b/lib/show_progress.c index d958a4468..bc067eac5 100644 --- a/lib/show_progress.c +++ b/lib/show_progress.c @@ -20,6 +20,7 @@ #include <common.h> #include <progress.h> #include <asm-generic/div64.h> +#include <linux/stringify.h> #define HASHES_PER_LINE 65 @@ -56,7 +57,7 @@ void init_progression_bar(int max) progress_max = max; spin = 0; if (progress_max) - printf("\t[%65s]\r\t[", ""); + printf("\t[%"__stringify(HASHES_PER_LINE)"s]\r\t[", ""); else printf("\t"); } |