summaryrefslogtreecommitdiff
path: root/include/globalvar.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-05-25 12:21:43 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-08-19 07:36:15 +0200
commitfa82936f249fb5762b639c15321b5a766d380343 (patch)
tree3a0e8c8e09351d17aafed38cbaa805236566d04d /include/globalvar.h
parent8f75aa496dcbf75e675a858c8223098fde066951 (diff)
downloadbarebox-fa82936f249fb5762b639c15321b5a766d380343.tar.gz
globalvar: Add helper for deprecated variable names
When globalvars are renamed across releases it's not nice when variables in the persistent environment loose their meaning. This adds a helper function which adds an alias for the old names. When the persistent variables still use the old names then their values are automatically written to variables with the new names. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/globalvar.h')
-rw-r--r--include/globalvar.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/globalvar.h b/include/globalvar.h
index fc85e93e14..db229e239c 100644
--- a/include/globalvar.h
+++ b/include/globalvar.h
@@ -33,6 +33,7 @@ int nvvar_remove(const char *name);
void globalvar_print(void);
void dev_param_init_from_nv(struct device_d *dev, const char *name);
+void globalvar_alias_deprecated(const char *newname, const char *oldname);
#else
static inline int globalvar_add_simple(const char *name, const char *value)
@@ -114,6 +115,10 @@ static inline void dev_param_init_from_nv(struct device_d *dev, const char *name
{
}
+static inline void globalvar_alias_deprecated(const char *newname, const char *oldname)
+{
+}
+
#endif
void nv_var_set_clean(void);