All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roese via U-Boot <u-boot@lists.u-boot-project.org>
To: Marek Vasut <marek.vasut+renesas@mailbox.org>,
	u-boot@lists.u-boot-project.org
Cc: Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH] mtd: cfi: Replace env_get_f() with env_get_yesno()
Date: Mon, 10 Aug 2026 10:28:57 +0200	[thread overview]
Message-ID: <cfca4027-3c8a-41d6-a8c5-602994df4822@mailbox.org> (raw)
In-Reply-To: <20260803231755.374057-1-marek.vasut+renesas@mailbox.org>

On 8/4/26 01:17, Marek Vasut wrote:
> Simplify the code, replace env_get_f() with env_get_yesno(). The
> env_get_yesno() internally calls env_get() which may fall back to
> env_get_f() if the environment access is not initialized yet.
> 
> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
> ---
> Cc: Stefan Roese <stefan.roese@mailbox.org>
> Cc: Tom Rini <trini@konsulko.com>
> Cc: u-boot@lists.u-boot-project.org

Reviewed-by: Stefan Roese <stefan.roese@mailbox.org>

@Tom, could you please pull this directly. AFAIU, we did not create
the cfi-flash custodian repo in the new infrastructure. I don't see a
real need for it, as CFI flash is just very rarely used nowadays.

Thanks,
Stefan

> ---
>   drivers/mtd/cfi_flash.c | 9 +--------
>   1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
> index e50502824ac..cf52abf1554 100644
> --- a/drivers/mtd/cfi_flash.c
> +++ b/drivers/mtd/cfi_flash.c
> @@ -2407,13 +2407,6 @@ unsigned long flash_init(void)
>   	unsigned long size = 0;
>   	int i;
>   
> -#ifdef CONFIG_SYS_FLASH_PROTECTION
> -	/* read environment from EEPROM */
> -	char s[64];
> -
> -	env_get_f("unlock", s, sizeof(s));
> -#endif
> -
>   #ifdef CONFIG_CFI_FLASH /* for driver model */
>   	cfi_flash_init_dm();
>   #endif
> @@ -2438,7 +2431,7 @@ unsigned long flash_init(void)
>   #endif /* CONFIG_SYS_FLASH_QUIET_TEST */
>   		}
>   #ifdef CONFIG_SYS_FLASH_PROTECTION
> -		else if (strcmp(s, "yes") == 0) {
> +		else if (env_get_yesno("unlock")) {
>   			/*
>   			 * Only the U-Boot image and it's environment
>   			 * is protected, all other sectors are


  reply	other threads:[~2026-08-10  8:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-03 23:17 [PATCH] mtd: cfi: Replace env_get_f() with env_get_yesno() Marek Vasut via U-Boot
2026-08-10  8:28 ` Stefan Roese via U-Boot [this message]
2026-08-10 10:01   ` Marek Vasut via U-Boot
2026-08-10 18:18   ` Tom Rini
2026-08-10 20:53 ` 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=cfca4027-3c8a-41d6-a8c5-602994df4822@mailbox.org \
    --to=u-boot@lists.u-boot-project.org \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=stefan.roese@mailbox.org \
    --cc=trini@konsulko.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.