Skip to content

Commit 41c7540

Browse files
JoshWucomputersforpeace
authored andcommitted
mtd: atmel_nand: don't map the ROM table if no pmecc table offset in DT
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]>
1 parent 477478a commit 41c7540

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/mtd/nand/atmel_nand.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,14 +1204,14 @@ static int atmel_pmecc_nand_init_params(struct platform_device *pdev,
12041204
goto err;
12051205
}
12061206

1207-
regs_rom = platform_get_resource(pdev, IORESOURCE_MEM, 3);
1208-
host->pmecc_rom_base = devm_ioremap_resource(&pdev->dev, regs_rom);
1209-
if (IS_ERR(host->pmecc_rom_base)) {
1210-
if (!host->has_no_lookup_table)
1211-
/* Don't display the information again */
1207+
if (!host->has_no_lookup_table) {
1208+
regs_rom = platform_get_resource(pdev, IORESOURCE_MEM, 3);
1209+
host->pmecc_rom_base = devm_ioremap_resource(&pdev->dev,
1210+
regs_rom);
1211+
if (IS_ERR(host->pmecc_rom_base)) {
12121212
dev_err(host->dev, "Can not get I/O resource for ROM, will build a lookup table in runtime!\n");
1213-
1214-
host->has_no_lookup_table = true;
1213+
host->has_no_lookup_table = true;
1214+
}
12151215
}
12161216

12171217
if (host->has_no_lookup_table) {

0 commit comments

Comments
 (0)