[U-Boot] [PATCH 1/3] nand: arasan_nfc: Move common ecc struct initialization init routine

Michal Simek monstr at monstr.eu
Tue Jan 16 10:49:10 UTC 2018


On 4.1.2018 11:34, Siva Durga Prasad Paladugu wrote:
> From: Siva Durga Prasad Paladugu <siva.durga.paladugu at xilinx.com>
> 
> Move common part of ecc structure initialization to
> arasan_nand_init() routine.
> 
> Signed-off-by: Siva Durga Prasad Paladugu <sivadur at xilinx.com>
> Signed-off-by: Michal Simek <michal.simek at xilinx.com>
> ---
>  drivers/mtd/nand/arasan_nfc.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/mtd/nand/arasan_nfc.c b/drivers/mtd/nand/arasan_nfc.c
> index 14b2733..dc956f8 100644
> --- a/drivers/mtd/nand/arasan_nfc.c
> +++ b/drivers/mtd/nand/arasan_nfc.c
> @@ -1038,13 +1038,6 @@ static int arasan_nand_ecc_init(struct mtd_info *mtd)
>  	u32 regval, eccpos_start, i;
>  	struct nand_chip *nand_chip = mtd_to_nand(mtd);
>  
> -	nand_chip->ecc.mode = NAND_ECC_HW;
> -	nand_chip->ecc.hwctl = NULL;
> -	nand_chip->ecc.read_page = arasan_nand_read_page_hwecc;
> -	nand_chip->ecc.write_page = arasan_nand_write_page_hwecc;
> -	nand_chip->ecc.read_oob = arasan_nand_read_oob;
> -	nand_chip->ecc.write_oob = arasan_nand_write_oob;
> -
>  	for (i = 0; i < ARRAY_SIZE(ecc_matrix); i++) {
>  		if ((ecc_matrix[i].pagesize == mtd->writesize) &&
>  		    (ecc_matrix[i].ecc_codeword_size >=
> @@ -1126,6 +1119,13 @@ static int arasan_nand_init(struct nand_chip *nand_chip, int devnum)
>  		goto fail;
>  	}
>  
> +	nand_chip->ecc.mode = NAND_ECC_HW;
> +	nand_chip->ecc.hwctl = NULL;
> +	nand_chip->ecc.read_page = arasan_nand_read_page_hwecc;
> +	nand_chip->ecc.write_page = arasan_nand_write_page_hwecc;
> +	nand_chip->ecc.read_oob = arasan_nand_read_oob;
> +	nand_chip->ecc.write_oob = arasan_nand_write_oob;
> +
>  	if (arasan_nand_ecc_init(mtd)) {
>  		printf("%s: nand_ecc_init failed\n", __func__);
>  		goto fail;
> 

Applied all. In v2 I have fixed checkpatch warning in commit message.

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP SoCs


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180116/1786cbe7/attachment.sig>


More information about the U-Boot mailing list