/* Returns 0 on success, a negative error code otherwise.  */
int nand_prog_page_end_op(struct nand_chip *chip)
/* Returns 0 on success, a negative error code otherwise.  */
int nand_prog_page_end_op(struct nand_chip *chip)
{
	struct mtd_info *mtd = nand_to_mtd(chip);
	int status;
	chip->cmdfunc(mtd, NAND_CMD_PAGEPROG, -1, -1);
	status = chip->waitfunc(mtd, chip);
	if (status & NAND_STATUS_FAIL)
		return -EIO;
	return 0;
}