* [PATCH] env: Switch the callback static list to Kconfig
@ 2024-11-19 10:57 Christoph Niedermaier
2024-11-19 14:21 ` Marek Vasut
0 siblings, 1 reply; 3+ messages in thread
From: Christoph Niedermaier @ 2024-11-19 10:57 UTC (permalink / raw)
To: u-boot
Cc: Christoph Niedermaier, Joe Hershberger, Marek Vasut, Tom Rini,
u-boot
Switch the callback static list from the board configuration varibale
CFG_ENV_CALLBACK_LIST_STATIC to Kconfig CONFIG_ENV_CALLBACK_LIST_STATIC.
Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
---
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Cc: u-boot@dh-electronics.com
---
doc/develop/environment.rst | 4 ++--
env/Kconfig | 13 +++++++++++++
include/env_callback.h | 7 +------
3 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/doc/develop/environment.rst b/doc/develop/environment.rst
index e1783462bb..e46cd39d60 100644
--- a/doc/develop/environment.rst
+++ b/doc/develop/environment.rst
@@ -18,8 +18,8 @@ The callbacks are named and associated with a function using the
U_BOOT_ENV_CALLBACK macro in your board or driver code.
These callbacks are associated with variables in one of two ways. The
-static list can be added to by defining CFG_ENV_CALLBACK_LIST_STATIC
-in the board configuration to a string that defines a list of
+static list can be added to by defining CONFIG_ENV_CALLBACK_LIST_STATIC
+in the board defconfig via menuconfig to a string that defines a list of
associations. The list must be in the following format::
entry = variable_name[:callback_name]
diff --git a/env/Kconfig b/env/Kconfig
index 031cf58186..aaf0b1fe9a 100644
--- a/env/Kconfig
+++ b/env/Kconfig
@@ -21,6 +21,19 @@ config ENV_SOURCE_FILE
environment is assumed to come from the ad-hoc
CFG_EXTRA_ENV_SETTINGS #define
+config ENV_CALLBACK_LIST_STATIC
+ string "Static callbacks list"
+ default ""
+ help
+ The environment callbacks are associated with variables in a
+ static list. Define this list in the following format:
+
+ entry = variable_name[:callback_name]
+ list = entry[,list]
+
+ If the callback name is not specified, then the callback is deleted.
+ Spaces are also allowed anywhere in the list.
+
config SAVEENV
def_bool y if CMD_SAVEENV
diff --git a/include/env_callback.h b/include/env_callback.h
index bc8ff1923e..47a31f6cf5 100644
--- a/include/env_callback.h
+++ b/include/env_callback.h
@@ -14,11 +14,6 @@
#define ENV_CALLBACK_VAR ".callbacks"
-/* Board configs can define additional static callback bindings */
-#ifndef CFG_ENV_CALLBACK_LIST_STATIC
-#define CFG_ENV_CALLBACK_LIST_STATIC
-#endif
-
#ifdef CONFIG_SILENT_CONSOLE
#define SILENT_CALLBACK "silent:silent,"
#else
@@ -90,7 +85,7 @@
SILENT_CALLBACK \
"stdin:console,stdout:console,stderr:console," \
"serial#:serialno," \
- CFG_ENV_CALLBACK_LIST_STATIC
+ CONFIG_ENV_CALLBACK_LIST_STATIC
#ifndef CONFIG_XPL_BUILD
void env_callback_init(struct env_entry *var_entry);
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] env: Switch the callback static list to Kconfig
2024-11-19 10:57 [PATCH] env: Switch the callback static list to Kconfig Christoph Niedermaier
@ 2024-11-19 14:21 ` Marek Vasut
2024-11-19 17:50 ` Christoph Niedermaier
0 siblings, 1 reply; 3+ messages in thread
From: Marek Vasut @ 2024-11-19 14:21 UTC (permalink / raw)
To: Christoph Niedermaier, u-boot; +Cc: Joe Hershberger, Tom Rini, u-boot
On 11/19/24 11:57 AM, Christoph Niedermaier wrote:
> Switch the callback static list from the board configuration varibale
variable , typo
> CFG_ENV_CALLBACK_LIST_STATIC to Kconfig CONFIG_ENV_CALLBACK_LIST_STATIC.
>
> Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
With the above typo fixed:
Reviewed-by: Marek Vasut <marex@denx.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] env: Switch the callback static list to Kconfig
2024-11-19 14:21 ` Marek Vasut
@ 2024-11-19 17:50 ` Christoph Niedermaier
0 siblings, 0 replies; 3+ messages in thread
From: Christoph Niedermaier @ 2024-11-19 17:50 UTC (permalink / raw)
To: Marek Vasut, u-boot@lists.denx.de; +Cc: Joe Hershberger, Tom Rini, u-boot
From: Marek Vasut <marex@denx.de>
Sent: Tuesday, November 19, 2024 3:22 PM
> On 11/19/24 11:57 AM, Christoph Niedermaier wrote:
>> Switch the callback static list from the board configuration varibale
>
> variable , typo
>
>> CFG_ENV_CALLBACK_LIST_STATIC to Kconfig CONFIG_ENV_CALLBACK_LIST_STATIC.
>>
>> Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
>
> With the above typo fixed:
>
> Reviewed-by: Marek Vasut <marex@denx.de>
OK, I will fix it in V2.
Regards
Christoph
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-11-19 17:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-19 10:57 [PATCH] env: Switch the callback static list to Kconfig Christoph Niedermaier
2024-11-19 14:21 ` Marek Vasut
2024-11-19 17:50 ` Christoph Niedermaier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox