diff mbox

mtd: atmel_nand: don't map the ROM table if no pmecc table offset in DT

Message ID 1427955227-8927-1-git-send-email-josh.wu@atmel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Josh Wu April 2, 2015, 6:13 a.m. UTC
if atmel,pmecc-lookup-table-offset is not found in DT node, we don't
need to map the ROM table as we will build a runtime gf table anyway.

Reported-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Josh Wu <josh.wu@atmel.com>
---

 drivers/mtd/nand/atmel_nand.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Comments

Nicolas Ferre April 2, 2015, 9:08 a.m. UTC | #1
Le 02/04/2015 08:13, Josh Wu a écrit :
> if atmel,pmecc-lookup-table-offset is not found in DT node, we don't
> need to map the ROM table as we will build a runtime gf table anyway.
> 
> Reported-by: Nicolas Ferre <nicolas.ferre@atmel.com>

Seems good:
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

> Signed-off-by: Josh Wu <josh.wu@atmel.com>
> ---
> 
>  drivers/mtd/nand/atmel_nand.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
> index 0361c19..46010bd 100644
> --- a/drivers/mtd/nand/atmel_nand.c
> +++ b/drivers/mtd/nand/atmel_nand.c
> @@ -1204,14 +1204,14 @@ static int atmel_pmecc_nand_init_params(struct platform_device *pdev,
>  		goto err;
>  	}
>  
> -	regs_rom = platform_get_resource(pdev, IORESOURCE_MEM, 3);
> -	host->pmecc_rom_base = devm_ioremap_resource(&pdev->dev, regs_rom);
> -	if (IS_ERR(host->pmecc_rom_base)) {
> -		if (!host->has_no_lookup_table)
> -			/* Don't display the information again */
> +	if (!host->has_no_lookup_table) {
> +		regs_rom = platform_get_resource(pdev, IORESOURCE_MEM, 3);
> +		host->pmecc_rom_base = devm_ioremap_resource(&pdev->dev,
> +								regs_rom);
> +		if (IS_ERR(host->pmecc_rom_base)) {
>  			dev_err(host->dev, "Can not get I/O resource for ROM, will build a lookup table in runtime!\n");
> -
> -		host->has_no_lookup_table = true;
> +			host->has_no_lookup_table = true;
> +		}
>  	}
>  
>  	if (host->has_no_lookup_table) {
>
Brian Norris April 6, 2015, 1 a.m. UTC | #2
On Thu, Apr 02, 2015 at 02:13:47PM +0800, Josh Wu wrote:
> if atmel,pmecc-lookup-table-offset is not found in DT node, we don't
> need to map the ROM table as we will build a runtime gf table anyway.
> 
> Reported-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> Signed-off-by: Josh Wu <josh.wu@atmel.com>

Pushed to l2-mtd.git.

Brian
diff mbox

Patch

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 0361c19..46010bd 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -1204,14 +1204,14 @@  static int atmel_pmecc_nand_init_params(struct platform_device *pdev,
 		goto err;
 	}
 
-	regs_rom = platform_get_resource(pdev, IORESOURCE_MEM, 3);
-	host->pmecc_rom_base = devm_ioremap_resource(&pdev->dev, regs_rom);
-	if (IS_ERR(host->pmecc_rom_base)) {
-		if (!host->has_no_lookup_table)
-			/* Don't display the information again */
+	if (!host->has_no_lookup_table) {
+		regs_rom = platform_get_resource(pdev, IORESOURCE_MEM, 3);
+		host->pmecc_rom_base = devm_ioremap_resource(&pdev->dev,
+								regs_rom);
+		if (IS_ERR(host->pmecc_rom_base)) {
 			dev_err(host->dev, "Can not get I/O resource for ROM, will build a lookup table in runtime!\n");
-
-		host->has_no_lookup_table = true;
+			host->has_no_lookup_table = true;
+		}
 	}
 
 	if (host->has_no_lookup_table) {