globalvar: Add support for printing all global variables
This could previously only be done with 'devinfo global'. While this is still possible this adds a more direct access via the globalvar command. This variant also adds a '*' in front of the variable if the corresponding non volatile variable exists. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
b25d333493
commit
32e879f0a3
|
@ -37,6 +37,11 @@ static int do_global(int argc, char *argv[])
|
|||
}
|
||||
}
|
||||
|
||||
if (argc == optind) {
|
||||
globalvar_print();
|
||||
return 0;
|
||||
}
|
||||
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
|
|
|
@ -197,6 +197,11 @@ void nvvar_print(void)
|
|||
device_param_print(&nv_device);
|
||||
}
|
||||
|
||||
void globalvar_print(void)
|
||||
{
|
||||
device_param_print(&global_device);
|
||||
}
|
||||
|
||||
/*
|
||||
* globalvar_get_match
|
||||
*
|
||||
|
|
|
@ -77,6 +77,7 @@ int nvvar_load(void);
|
|||
void nvvar_print(void);
|
||||
int nvvar_add(const char *name, const char *value);
|
||||
int nvvar_remove(const char *name);
|
||||
void globalvar_print(void);
|
||||
|
||||
#else
|
||||
static inline int globalvar_add_simple(const char *name, const char *value)
|
||||
|
|
Loading…
Reference in New Issue