Re: [PATCH v2 11/11] mtd: rawnand: micron: Allow controllers to overload raw accessors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 29 Apr 2020 17:55:40 +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 when
> these hooks are supported.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>

I would have merged this patch in patch 10, but that's not a big deal.

Reviewed-by: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx>

> ---
>  drivers/mtd/nand/raw/nand_micron.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/nand/raw/nand_micron.c b/drivers/mtd/nand/raw/nand_micron.c
> index 56654030ec7f..3f109ab31fa1 100644
> --- a/drivers/mtd/nand/raw/nand_micron.c
> +++ b/drivers/mtd/nand/raw/nand_micron.c
> @@ -508,8 +508,10 @@ static int micron_nand_init(struct nand_chip *chip)
>  			chip->ecc.read_page_raw = nand_read_page_raw_notsupp;
>  			chip->ecc.write_page_raw = nand_write_page_raw_notsupp;
>  		} else {
> -			chip->ecc.read_page_raw = nand_read_page_raw;
> -			chip->ecc.write_page_raw = nand_write_page_raw;
> +			if (!chip->ecc.read_page_raw)
> +				chip->ecc.read_page_raw = nand_read_page_raw;
> +			if (!chip->ecc.write_page_raw)
> +				chip->ecc.write_page_raw = nand_write_page_raw;
>  		}
>  	}
>  


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux