2012-11-20 16:29:42 +00:00
|
|
|
--- a/drivers/mtd/nand/ar934x_nfc.c
|
|
|
|
+++ b/drivers/mtd/nand/ar934x_nfc.c
|
2012-12-10 10:38:07 +00:00
|
|
|
@@ -786,6 +786,18 @@ ar934x_nfc_read_buf(struct mtd_info *mtd
|
2012-11-20 16:29:42 +00:00
|
|
|
nfc->buf_index = buf_index;
|
|
|
|
}
|
|
|
|
|
|
|
|
+static int
|
|
|
|
+ar934x_nfc_verify_buf(struct mtd_info *mtd, const u_char *buf, int len)
|
|
|
|
+{
|
|
|
|
+ int i;
|
|
|
|
+
|
|
|
|
+ for (i = 0; i < len; i++)
|
|
|
|
+ if (buf[i] != ar934x_nfc_read_byte(mtd))
|
|
|
|
+ return -EFAULT;
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
static void
|
|
|
|
ar934x_nfc_hw_init(struct ar934x_nfc *nfc)
|
|
|
|
{
|
2012-12-10 10:38:07 +00:00
|
|
|
@@ -1072,6 +1084,7 @@ ar934x_nfc_probe(struct platform_device
|
2012-11-20 16:29:42 +00:00
|
|
|
nand->read_byte = ar934x_nfc_read_byte;
|
|
|
|
nand->write_buf = ar934x_nfc_write_buf;
|
|
|
|
nand->read_buf = ar934x_nfc_read_buf;
|
|
|
|
+ nand->verify_buf = ar934x_nfc_verify_buf;
|
|
|
|
nand->select_chip = ar934x_nfc_select_chip;
|
|
|
|
|
|
|
|
ret = ar934x_nfc_alloc_buf(nfc, AR934X_NFC_ID_BUF_SIZE);
|