Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: nand: denali: remove detect_partition_feature()

The denali->fwblks is set by detect_partition_feature(), but it is
not referenced from anywhere. That means the struct member fwblks
and the whole of detect_partition_feature() are unneeded.

The comment block implies this function is only for Intel platforms.
I found drivers/staging/spectra used to exist, but it was deleted by
commit be7f39c5ecf5 ("Staging: delete spectra driver") 5 years ago.

So, I guess nobody would need this function any more.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>

authored by

Masahiro Yamada and committed by
Boris Brezillon
c9e02584 50d5f2a0

-38
-29
drivers/mtd/nand/denali.c
··· 473 473 denali->max_banks = 1 << (features & FEATURES__N_BANKS); 474 474 } 475 475 476 - static void detect_partition_feature(struct denali_nand_info *denali) 477 - { 478 - /* 479 - * For MRST platform, denali->fwblks represent the 480 - * number of blocks firmware is taken, 481 - * FW is in protect partition and MTD driver has no 482 - * permission to access it. So let driver know how many 483 - * blocks it can't touch. 484 - */ 485 - if (ioread32(denali->flash_reg + FEATURES) & FEATURES__PARTITION) { 486 - if ((ioread32(denali->flash_reg + PERM_SRC_ID(1)) & 487 - PERM_SRC_ID__SRCID) == SPECTRA_PARTITION_ID) { 488 - denali->fwblks = 489 - ((ioread32(denali->flash_reg + MIN_MAX_BANK(1)) & 490 - MIN_MAX_BANK__MIN_VALUE) * 491 - denali->blksperchip) 492 - + 493 - (ioread32(denali->flash_reg + MIN_BLK_ADDR(1)) & 494 - MIN_BLK_ADDR__VALUE); 495 - } else { 496 - denali->fwblks = SPECTRA_START_BLOCK; 497 - } 498 - } else { 499 - denali->fwblks = SPECTRA_START_BLOCK; 500 - } 501 - } 502 - 503 476 static uint16_t denali_nand_timing_set(struct denali_nand_info *denali) 504 477 { 505 478 uint16_t status = PASS; ··· 523 550 ioread32(denali->flash_reg + CS_SETUP_CNT)); 524 551 525 552 find_valid_banks(denali); 526 - 527 - detect_partition_feature(denali); 528 553 529 554 /* 530 555 * If the user specified to override the default timings
-9
drivers/mtd/nand/denali.h
··· 383 383 #define CLK_X 5 384 384 #define CLK_MULTI 4 385 385 386 - /* spectraswconfig.h */ 387 - #define CMD_DMA 0 388 - 389 - #define SPECTRA_PARTITION_ID 0 390 - /**** Block Table and Reserved Block Parameters *****/ 391 - #define SPECTRA_START_BLOCK 3 392 - #define NUM_FREE_BLOCKS_GATE 30 393 - 394 386 /* KBV - Updated to LNW scratch register address */ 395 387 #define SCRATCH_REG_ADDR CONFIG_MTD_NAND_DENALI_SCRATCH_REG_ADDR 396 388 #define SCRATCH_REG_SIZE 64 ··· 462 470 int irq; 463 471 464 472 uint32_t devnum; /* represent how many nands connected */ 465 - uint32_t fwblks; /* represent how many blocks FW used */ 466 473 uint32_t totalblks; 467 474 uint32_t blksperchip; 468 475 uint32_t bbtskipbytes;