summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2017-03-22 16:07:24 -0400
committerBoris Brezillon <boris.brezillon@free-electrons.com>2017-03-28 08:24:46 -0400
commite713ddd87ccee801be1fd13f478407b1bde93c21 (patch)
tree2e47dc253a4ee1a52b5caae1e76a39d0c5370026 /drivers/mtd/nand
parent6652ef88c4a7036e8f5e900f47a4daf2a9ba30c8 (diff)
mtd: nand: denali: remove unnecessary writes to ECC_CORRECTION
Because SUPPORT_15BITECC is defined, the following is dead code: #elif SUPPORT_8BITECC iowrite32(8, denali->flash_reg + ECC_CORRECTION); #endif Such ifdefs are useless and unacceptable coding style. These writes are not needed in the first place since ECC_CORRECTION is set up by the nand_init() function. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r--drivers/mtd/nand/denali.c15
-rw-r--r--drivers/mtd/nand/denali.h3
2 files changed, 1 insertions, 17 deletions
diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
index 1a2e0638affc..4ca75d3926ef 100644
--- a/drivers/mtd/nand/denali.c
+++ b/drivers/mtd/nand/denali.c
@@ -62,8 +62,6 @@ MODULE_PARM_DESC(onfi_timing_mode,
62 */ 62 */
63#define CHIP_SELECT_INVALID -1 63#define CHIP_SELECT_INVALID -1
64 64
65#define SUPPORT_8BITECC 1
66
67/* 65/*
68 * This macro divides two integers and rounds fractional values up 66 * This macro divides two integers and rounds fractional values up
69 * to the nearest integer value. 67 * to the nearest integer value.
@@ -347,14 +345,8 @@ static void get_toshiba_nand_para(struct denali_nand_info *denali)
347 * spare area size for some kind of Toshiba NAND device 345 * spare area size for some kind of Toshiba NAND device
348 */ 346 */
349 if ((ioread32(denali->flash_reg + DEVICE_MAIN_AREA_SIZE) == 4096) && 347 if ((ioread32(denali->flash_reg + DEVICE_MAIN_AREA_SIZE) == 4096) &&
350 (ioread32(denali->flash_reg + DEVICE_SPARE_AREA_SIZE) == 64)) { 348 (ioread32(denali->flash_reg + DEVICE_SPARE_AREA_SIZE) == 64))
351 iowrite32(216, denali->flash_reg + DEVICE_SPARE_AREA_SIZE); 349 iowrite32(216, denali->flash_reg + DEVICE_SPARE_AREA_SIZE);
352#if SUPPORT_15BITECC
353 iowrite32(15, denali->flash_reg + ECC_CORRECTION);
354#elif SUPPORT_8BITECC
355 iowrite32(8, denali->flash_reg + ECC_CORRECTION);
356#endif
357 }
358} 350}
359 351
360static void get_hynix_nand_para(struct denali_nand_info *denali, 352static void get_hynix_nand_para(struct denali_nand_info *denali,
@@ -367,11 +359,6 @@ static void get_hynix_nand_para(struct denali_nand_info *denali,
367 iowrite32(4096, denali->flash_reg + DEVICE_MAIN_AREA_SIZE); 359 iowrite32(4096, denali->flash_reg + DEVICE_MAIN_AREA_SIZE);
368 iowrite32(224, denali->flash_reg + DEVICE_SPARE_AREA_SIZE); 360 iowrite32(224, denali->flash_reg + DEVICE_SPARE_AREA_SIZE);
369 iowrite32(0, denali->flash_reg + DEVICE_WIDTH); 361 iowrite32(0, denali->flash_reg + DEVICE_WIDTH);
370#if SUPPORT_15BITECC
371 iowrite32(15, denali->flash_reg + ECC_CORRECTION);
372#elif SUPPORT_8BITECC
373 iowrite32(8, denali->flash_reg + ECC_CORRECTION);
374#endif
375 break; 362 break;
376 default: 363 default:
377 dev_warn(denali->dev, 364 dev_warn(denali->dev,
diff --git a/drivers/mtd/nand/denali.h b/drivers/mtd/nand/denali.h
index 7b2d7851ed7b..483c0e988f33 100644
--- a/drivers/mtd/nand/denali.h
+++ b/drivers/mtd/nand/denali.h
@@ -292,9 +292,6 @@
292#define CLK_X 5 292#define CLK_X 5
293#define CLK_MULTI 4 293#define CLK_MULTI 4
294 294
295#define SUPPORT_15BITECC 1
296#define SUPPORT_8BITECC 1
297
298#define ONFI_BLOOM_TIME 1 295#define ONFI_BLOOM_TIME 1
299#define MODE5_WORKAROUND 0 296#define MODE5_WORKAROUND 0
300 297