On Wed, 29 Apr 2020 17:55:39 +0200 Miquel Raynal <miquel.raynal@xxxxxxxxxxx> wrote: > Some controller drivers do not support executing regular > nand_read/write_page_raw() helpers. For that, we created > nand_monolithic_read/write_page_raw() alternatives. Let's now allow > the driver to overload the ECC ->read/write_page_raw() hooks. > > Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx> Reviewed-by: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx> > --- > drivers/mtd/nand/raw/nand_base.c | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c > index 2e525cb5a4e4..b265bdd38265 100644 > --- a/drivers/mtd/nand/raw/nand_base.c > +++ b/drivers/mtd/nand/raw/nand_base.c > @@ -5206,8 +5206,10 @@ static int nand_set_ecc_soft_ops(struct nand_chip *chip) > ecc->read_page = nand_read_page_swecc; > ecc->read_subpage = nand_read_subpage; > ecc->write_page = nand_write_page_swecc; > - ecc->read_page_raw = nand_read_page_raw; > - ecc->write_page_raw = nand_write_page_raw; > + if (!ecc->read_page_raw) > + ecc->read_page_raw = nand_read_page_raw; > + if (!ecc->write_page_raw) > + ecc->write_page_raw = nand_write_page_raw; > ecc->read_oob = nand_read_oob_std; > ecc->write_oob = nand_write_oob_std; > if (!ecc->size) > @@ -5229,8 +5231,10 @@ static int nand_set_ecc_soft_ops(struct nand_chip *chip) > ecc->read_page = nand_read_page_swecc; > ecc->read_subpage = nand_read_subpage; > ecc->write_page = nand_write_page_swecc; > - ecc->read_page_raw = nand_read_page_raw; > - ecc->write_page_raw = nand_write_page_raw; > + if (!ecc->read_page_raw) > + ecc->read_page_raw = nand_read_page_raw; > + if (!ecc->write_page_raw) > + ecc->write_page_raw = nand_write_page_raw; > ecc->read_oob = nand_read_oob_std; > ecc->write_oob = nand_write_oob_std; > ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/