mtd: rawnand: atmel: Use nand_prog_page_end_op()
The nand_prog_page_end_op() sequence is open-coded in atmel_hsmc_nand_pmecc_write_pg(). Let's use the generic helper here. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200720131356.1579073-5-tudor.ambarus@microchip.com
This commit is contained in:
parent
5b2baf1fe5
commit
060c931c94
|
@ -902,7 +902,7 @@ static int atmel_hsmc_nand_pmecc_write_pg(struct nand_chip *chip,
|
|||
struct mtd_info *mtd = nand_to_mtd(chip);
|
||||
struct atmel_nand *nand = to_atmel_nand(chip);
|
||||
struct atmel_hsmc_nand_controller *nc;
|
||||
int ret, status;
|
||||
int ret;
|
||||
|
||||
nc = to_hsmc_nand_controller(chip->controller);
|
||||
|
||||
|
@ -936,19 +936,7 @@ static int atmel_hsmc_nand_pmecc_write_pg(struct nand_chip *chip,
|
|||
|
||||
nand_write_data_op(chip, chip->oob_poi, mtd->oobsize, false);
|
||||
|
||||
nc->op.cmds[0] = NAND_CMD_PAGEPROG;
|
||||
nc->op.ncmds = 1;
|
||||
nc->op.cs = nand->activecs->id;
|
||||
ret = atmel_nfc_exec_op(nc, false);
|
||||
if (ret)
|
||||
dev_err(nc->base.dev, "Failed to program NAND page (err = %d)\n",
|
||||
ret);
|
||||
|
||||
status = chip->legacy.waitfunc(chip);
|
||||
if (status & NAND_STATUS_FAIL)
|
||||
return -EIO;
|
||||
|
||||
return ret;
|
||||
return nand_prog_page_end_op(chip);
|
||||
}
|
||||
|
||||
static int atmel_hsmc_nand_pmecc_write_page(struct nand_chip *chip,
|
||||
|
|
Loading…
Reference in New Issue