Patchwork [U-Boot,8/9] imx: nand: Don't invent new configuration variable

login
register
mail settings
Submitter Timo Ketola
Date April 13, 2012, 11:21 a.m.
Message ID <1334316061-26019-9-git-send-email-timo@exertus.fi>
Download mbox | patch
Permalink /patch/152288/
State Changes Requested
Delegated to: Stefano Babic
Headers show

Comments

Timo Ketola - April 13, 2012, 11:21 a.m.
There is already CONFIG_SYS_NAND_BASE (or CONFIG_SYS_NAND_BASE_LIST) which
must be defined for nand.c. Use that. nand.c sets IO_ADDR_R with that.

Signed-off-by: Timo Ketola <timo@exertus.fi>
---
 drivers/mtd/nand/mxc_nand.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Scott Wood - April 13, 2012, 5:21 p.m.
On 04/13/2012 06:21 AM, Timo Ketola wrote:
> There is already CONFIG_SYS_NAND_BASE (or CONFIG_SYS_NAND_BASE_LIST) which
> must be defined for nand.c. Use that. nand.c sets IO_ADDR_R with that.
> 
> Signed-off-by: Timo Ketola <timo@exertus.fi>
> ---
>  drivers/mtd/nand/mxc_nand.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
> index 73813a2..fcee20d 100644
> --- a/drivers/mtd/nand/mxc_nand.c
> +++ b/drivers/mtd/nand/mxc_nand.c
> @@ -1361,7 +1361,7 @@ int board_nand_init(struct nand_chip *this)
>  	this->read_buf = mxc_nand_read_buf;
>  	this->verify_buf = mxc_nand_verify_buf;
>  
> -	host->regs = (struct nfc_regs __iomem *)CONFIG_MXC_NAND_REGS_BASE;
> +	host->regs = this->IO_ADDR_R;
>  	host->clk_act = 1;
>  
>  #ifdef CONFIG_MXC_NAND_HWECC

Actually, I'd rather we go the other direction and deprecate
CONFIG_SYS_NAND_BASE (see CONFIG_SYS_NAND_SELF_INIT).

-Scott
Timo Ketola - April 13, 2012, 6:28 p.m.
On 13.04.2012 20:21, Scott Wood wrote:
> On 04/13/2012 06:21 AM, Timo Ketola wrote:
>> There is already CONFIG_SYS_NAND_BASE (or CONFIG_SYS_NAND_BASE_LIST) which
>> must be defined for nand.c. Use that. nand.c sets IO_ADDR_R with that.
>> ...
>
> Actually, I'd rather we go the other direction and deprecate
> CONFIG_SYS_NAND_BASE (see CONFIG_SYS_NAND_SELF_INIT).

Maybe it's better for me to drop this patch...

--

Timo

Patch

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index 73813a2..fcee20d 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -1361,7 +1361,7 @@  int board_nand_init(struct nand_chip *this)
 	this->read_buf = mxc_nand_read_buf;
 	this->verify_buf = mxc_nand_verify_buf;
 
-	host->regs = (struct nfc_regs __iomem *)CONFIG_MXC_NAND_REGS_BASE;
+	host->regs = this->IO_ADDR_R;
 	host->clk_act = 1;
 
 #ifdef CONFIG_MXC_NAND_HWECC