1 --- a/drivers/mtd/nand/rb750_nand.c
2 +++ b/drivers/mtd/nand/rb750_nand.c
3 @@ -110,7 +110,8 @@ static void rb750_nand_write(const u8 *b
4 __raw_readl(base + AR71XX_GPIO_REG_OE);
7 -static void rb750_nand_read(u8 *read_buf, unsigned len)
8 +static int rb750_nand_read_verify(u8 *read_buf, unsigned len,
9 + const u8 *verify_buf)
11 void __iomem *base = ath79_gpio_base;
13 @@ -130,8 +131,13 @@ static void rb750_nand_read(u8 *read_buf
14 /* deactivate RE line */
15 __raw_writel(RB750_NAND_NRE, base + AR71XX_GPIO_REG_SET);
20 + else if (verify_buf && verify_buf[i] != data)
27 static void rb750_nand_select_chip(struct mtd_info *mtd, int chip)
28 @@ -206,13 +212,13 @@ static void rb750_nand_cmd_ctrl(struct m
29 static u8 rb750_nand_read_byte(struct mtd_info *mtd)
32 - rb750_nand_read(&data, 1);
33 + rb750_nand_read_verify(&data, 1, NULL);
37 static void rb750_nand_read_buf(struct mtd_info *mtd, u8 *buf, int len)
39 - rb750_nand_read(buf, len);
40 + rb750_nand_read_verify(buf, len, NULL);
43 static void rb750_nand_write_buf(struct mtd_info *mtd, const u8 *buf, int len)
44 @@ -220,6 +226,11 @@ static void rb750_nand_write_buf(struct
45 rb750_nand_write(buf, len);
48 +static int rb750_nand_verify_buf(struct mtd_info *mtd, const u8 *buf, int len)
50 + return rb750_nand_read_verify(NULL, len, buf);
53 static void __init rb750_nand_gpio_init(struct rb750_nand_info *info)
55 void __iomem *base = ath79_gpio_base;
56 @@ -274,6 +285,7 @@ static int __devinit rb750_nand_probe(st
57 info->chip.read_byte = rb750_nand_read_byte;
58 info->chip.write_buf = rb750_nand_write_buf;
59 info->chip.read_buf = rb750_nand_read_buf;
60 + info->chip.verify_buf = rb750_nand_verify_buf;
62 info->chip.chip_delay = 25;
63 info->chip.ecc.mode = NAND_ECC_SOFT;