diff mbox

[U-Boot] cfi_flash: Fix CONFIG_SYS_FLASH_AUTOPROTECT_LIST

Message ID 1302723141-8296-1-git-send-email-afleming@freescale.com
State Superseded
Headers show

Commit Message

Andy Fleming April 13, 2011, 7:32 p.m. UTC
The patch which created flash_protect_default(), moved the autoprotect
list code into that function, but left its variable declarations in
the init function.

Signed-off-by: Andy Fleming <afleming@freescale.com>
---
 drivers/mtd/cfi_flash.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

Comments

Andy Fleming April 13, 2011, 7:35 p.m. UTC | #1
Ha!  That's what I get for reading my emails in reverse.  Peter
already fixed it.

On Wed, Apr 13, 2011 at 2:32 PM, Andy Fleming <afleming@freescale.com> wrote:
> The patch which created flash_protect_default(), moved the autoprotect
> list code into that function, but left its variable declarations in
> the init function.
>
> Signed-off-by: Andy Fleming <afleming@freescale.com>
> ---
>  drivers/mtd/cfi_flash.c |   15 ++++++++-------
>  1 files changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
> index 5788328..ff2450b 100644
> --- a/drivers/mtd/cfi_flash.c
> +++ b/drivers/mtd/cfi_flash.c
> @@ -2089,6 +2089,14 @@ static void cfi_flash_set_config_reg(u32 base, u16 val)
>
>  void flash_protect_default(void)
>  {
> +#if defined(CONFIG_SYS_FLASH_AUTOPROTECT_LIST)
> +       int i;
> +       struct apl_s {
> +               ulong start;
> +               ulong size;
> +       } apl[] = CONFIG_SYS_FLASH_AUTOPROTECT_LIST;
> +#endif
> +
>        /* Monitor protection ON by default */
>  #if (CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE) && \
>        (!defined(CONFIG_MONITOR_IS_IN_RAM))
> @@ -2130,13 +2138,6 @@ unsigned long flash_init (void)
>  {
>        unsigned long size = 0;
>        int i;
> -#if defined(CONFIG_SYS_FLASH_AUTOPROTECT_LIST)
> -       struct apl_s {
> -               ulong start;
> -               ulong size;
> -       } apl[] = CONFIG_SYS_FLASH_AUTOPROTECT_LIST;
> -#endif
> -
>  #ifdef CONFIG_SYS_FLASH_PROTECTION
>        /* read environment from EEPROM */
>        char s[64];
> --
> 1.6.5.2.g6ff9a
>
>
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
diff mbox

Patch

diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 5788328..ff2450b 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -2089,6 +2089,14 @@  static void cfi_flash_set_config_reg(u32 base, u16 val)
 
 void flash_protect_default(void)
 {
+#if defined(CONFIG_SYS_FLASH_AUTOPROTECT_LIST)
+	int i;
+	struct apl_s {
+		ulong start;
+		ulong size;
+	} apl[] = CONFIG_SYS_FLASH_AUTOPROTECT_LIST;
+#endif
+
 	/* Monitor protection ON by default */
 #if (CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE) && \
 	(!defined(CONFIG_MONITOR_IS_IN_RAM))
@@ -2130,13 +2138,6 @@  unsigned long flash_init (void)
 {
 	unsigned long size = 0;
 	int i;
-#if defined(CONFIG_SYS_FLASH_AUTOPROTECT_LIST)
-	struct apl_s {
-		ulong start;
-		ulong size;
-	} apl[] = CONFIG_SYS_FLASH_AUTOPROTECT_LIST;
-#endif
-
 #ifdef CONFIG_SYS_FLASH_PROTECTION
 	/* read environment from EEPROM */
 	char s[64];