lkml.org 
[lkml]   [2020]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.6 009/126] mtd: spinand: Propagate ECC information to the MTD structure
    Date
    From: Miquel Raynal <miquel.raynal@bootlin.com>

    [ Upstream commit 3507273d5a4d3c2e46f9d3f9ed9449805f5dff07 ]

    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: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI NANDs")
    Cc: stable@vger.kernel.org
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
    Signed-off-by: Richard Weinberger <richard@nod.at>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/mtd/nand/spi/core.c | 4 ++++
    1 file changed, 4 insertions(+)

    diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
    index 8dda51bbdd11..0d21c68bfe24 100644
    --- a/drivers/mtd/nand/spi/core.c
    +++ b/drivers/mtd/nand/spi/core.c
    @@ -1049,6 +1049,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:
    --
    2.25.1


    \
     
     \ /
      Last update: 2020-05-26 21:12    [W:3.941 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site