Skip to content

Commit

Permalink
mtd: atmel_nand: don't map the ROM table if no pmecc table offset in DT
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Josh Wu <[email protected]>
Acked-by: Nicolas Ferre <[email protected]>
Signed-off-by: Brian Norris <[email protected]>
  • Loading branch information
JoshWu authored and computersforpeace committed Apr 6, 2015
1 parent 477478a commit 41c7540
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions drivers/mtd/nand/atmel_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 41c7540

Please sign in to comment.