diff options
| author | Miquel Raynal <[email protected]> | 2020-08-27 08:52:02 +0000 |
|---|---|---|
| committer | Miquel Raynal <[email protected]> | 2020-09-28 13:59:48 +0000 |
| commit | 53576c7bfc3589fc7cd58cc952168db0449886a7 (patch) | |
| tree | ac40227c3cb2678579f7788fdea63fe1bf886b2c /drivers/mtd/nand/raw/atmel/nand-controller.c | |
| parent | mtd: nand: Create helpers to set/extract the ECC requirements (diff) | |
| download | kernel-53576c7bfc3589fc7cd58cc952168db0449886a7.tar.gz kernel-53576c7bfc3589fc7cd58cc952168db0449886a7.zip | |
mtd: rawnand: Use nanddev_get/set_ecc_requirements() when relevant
Instead of accessing ->strength/step_size directly.
Signed-off-by: Miquel Raynal <[email protected]>
Link: https://lore.kernel.org/linux-mtd/[email protected]
Diffstat (limited to 'drivers/mtd/nand/raw/atmel/nand-controller.c')
| -rw-r--r-- | drivers/mtd/nand/raw/atmel/nand-controller.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/mtd/nand/raw/atmel/nand-controller.c b/drivers/mtd/nand/raw/atmel/nand-controller.c index 0d9cd7faf00d..3d162fdc9ce2 100644 --- a/drivers/mtd/nand/raw/atmel/nand-controller.c +++ b/drivers/mtd/nand/raw/atmel/nand-controller.c @@ -1043,6 +1043,8 @@ static int atmel_hsmc_nand_pmecc_read_page_raw(struct nand_chip *chip, static int atmel_nand_pmecc_init(struct nand_chip *chip) { + const struct nand_ecc_props *requirements = + nanddev_get_ecc_requirements(&chip->base); struct mtd_info *mtd = nand_to_mtd(chip); struct atmel_nand *nand = to_atmel_nand(chip); struct atmel_nand_controller *nc; @@ -1072,15 +1074,15 @@ static int atmel_nand_pmecc_init(struct nand_chip *chip) req.ecc.strength = ATMEL_PMECC_MAXIMIZE_ECC_STRENGTH; else if (chip->ecc.strength) req.ecc.strength = chip->ecc.strength; - else if (chip->base.eccreq.strength) - req.ecc.strength = chip->base.eccreq.strength; + else if (requirements->strength) + req.ecc.strength = requirements->strength; else req.ecc.strength = ATMEL_PMECC_MAXIMIZE_ECC_STRENGTH; if (chip->ecc.size) req.ecc.sectorsize = chip->ecc.size; - else if (chip->base.eccreq.step_size) - req.ecc.sectorsize = chip->base.eccreq.step_size; + else if (requirements->step_size) + req.ecc.sectorsize = requirements->step_size; else req.ecc.sectorsize = ATMEL_PMECC_SECTOR_SIZE_AUTO; |
