Skip to content

Commit

Permalink
mtd: spinand: Propagate ECC information to the MTD structure
Browse files Browse the repository at this point in the history
This is done by default in the raw NAND core (nand_base.c) but was
missing in the SPI-NAND core. Without these two lines the ecc_strength
and ecc_step_size values are not exported to the user through sysfs.

Fixes: 7529df4 ("mtd: nand: Add core infrastructure to support SPI NANDs")
Cc: [email protected]
Signed-off-by: Miquel Raynal <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
  • Loading branch information
miquelraynal authored and richardweinberger committed May 18, 2020
1 parent 9b1f2cb commit 3507273
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/mtd/nand/spi/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,10 @@ static int spinand_init(struct spinand_device *spinand)

mtd->oobavail = ret;

/* Propagate ECC information to mtd_info */
mtd->ecc_strength = nand->eccreq.strength;
mtd->ecc_step_size = nand->eccreq.step_size;

return 0;

err_cleanup_nanddev:
Expand Down

0 comments on commit 3507273

Please sign in to comment.