public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Cc: Shengzhou Liu <Shengzhou.Liu@nxp.com>,
	Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Subject: [PATCH v2 2/2] env: remote: Disallow CMD_SAVEENV
Date: Mon, 23 Mar 2026 13:51:06 -0600	[thread overview]
Message-ID: <20260323195106.2362981-2-trini@konsulko.com> (raw)
In-Reply-To: <20260323195106.2362981-1-trini@konsulko.com>

Looking at how the saveenv portion of this driver was implemented, it
does not appear that it could actually result in changes being saved on
the remote end. Update Kconfig to disallow CMD_SAVEENV for
ENV_IS_IN_REMOTE and then remove the relevant code.

Signed-off-by: Tom Rini <trini@konsulko.com>

---
Changes in v2:
- New patch

Cc: Shengzhou Liu <Shengzhou.Liu@nxp.com>
Cc: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
---
 cmd/Kconfig  |  1 +
 env/remote.c | 13 -------------
 2 files changed, 1 insertion(+), 13 deletions(-)

diff --git a/cmd/Kconfig b/cmd/Kconfig
index bf47b440756c..24dc7fa54273 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -717,6 +717,7 @@ config CMD_GREPENV
 
 config CMD_SAVEENV
 	bool "saveenv"
+	depends on !(SRIO_PCIE_BOOT_SLAVE && ENV_IS_IN_REMOTE)
 	default y
 	help
 	  Save all environment variables into the compiled-in persistent
diff --git a/env/remote.c b/env/remote.c
index 0cc383c23602..5dd929155a43 100644
--- a/env/remote.c
+++ b/env/remote.c
@@ -31,18 +31,6 @@ static int env_remote_init(void)
 	return -ENOENT;
 }
 
-#ifdef CONFIG_CMD_SAVEENV
-static int env_remote_save(void)
-{
-#ifdef CONFIG_SRIO_PCIE_BOOT_SLAVE
-	printf("Can not support the 'saveenv' when boot from SRIO or PCIE!\n");
-	return 1;
-#else
-	return 0;
-#endif
-}
-#endif /* CONFIG_CMD_SAVEENV */
-
 static int env_remote_load(void)
 {
 #ifndef ENV_IS_EMBEDDED
@@ -56,6 +44,5 @@ U_BOOT_ENV_LOCATION(remote) = {
 	.location	= ENVL_REMOTE,
 	ENV_NAME("Remote")
 	.load		= env_remote_load,
-	.save		= env_save_ptr(env_remote_save),
 	.init		= env_remote_init,
 };
-- 
2.43.0


  reply	other threads:[~2026-03-23 19:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-20 20:53 [PATCH] env: Make more use of the ENV_SAVE_PTR macro Tom Rini
2026-03-23 19:51 ` [PATCH v2 1/2] " Tom Rini
2026-03-23 19:51   ` Tom Rini [this message]
2026-04-07 19:50   ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260323195106.2362981-2-trini@konsulko.com \
    --to=trini@konsulko.com \
    --cc=Shengzhou.Liu@nxp.com \
    --cc=rasmus.villemoes@prevas.dk \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox