diff options
author | Joe Hershberger | 2015-05-20 14:27:19 -0500 |
---|---|---|
committer | Tom Rini | 2015-05-21 09:13:19 -0400 |
commit | cca98fd6aa111f622be09ffdb5c59684c5e160af (patch) | |
tree | b6390d453a085825c1d260dbe69a2433d6f86b77 /common/env_callback.c | |
parent | 032ea185d644cfe420822dd3dc84734623ffac91 (diff) |
env: Allow env_attr_walk to pass a priv * to callback
In some cases it can be helpful to have context in the callback about
the calling situation. This is needed for following patches.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/env_callback.c')
-rw-r--r-- | common/env_callback.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/common/env_callback.c b/common/env_callback.c index d03fa03a436..f4d3dbd77fa 100644 --- a/common/env_callback.c +++ b/common/env_callback.c @@ -90,7 +90,7 @@ static int clear_callback(ENTRY *entry) /* * Call for each element in the list that associates variables to callbacks */ -static int set_callback(const char *name, const char *value) +static int set_callback(const char *name, const char *value, void *priv) { ENTRY e, *ep; struct env_clbk_tbl *clbkp; @@ -126,9 +126,9 @@ static int on_callbacks(const char *name, const char *value, enum env_op op, hwalk_r(&env_htab, clear_callback); /* configure any static callback bindings */ - env_attr_walk(ENV_CALLBACK_LIST_STATIC, set_callback); + env_attr_walk(ENV_CALLBACK_LIST_STATIC, set_callback, NULL); /* configure any dynamic callback bindings */ - env_attr_walk(value, set_callback); + env_attr_walk(value, set_callback, NULL); return 0; } |