ar71xx: make ar934x_nfc driver compatible with 3.7
authorGabor Juhos <juhosg@openwrt.org>
Tue, 20 Nov 2012 16:29:42 +0000 (16:29 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Tue, 20 Nov 2012 16:29:42 +0000 (16:29 +0000)
Also add compatibility patches for the currently
supported kernels.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
SVN-Revision: 34278

target/linux/ar71xx/files/drivers/mtd/nand/ar934x_nfc.c
target/linux/ar71xx/patches-3.3/a02-ar934x_nfc-add-NO_AUTOINCR-flag.patch
target/linux/ar71xx/patches-3.3/a05-ar934x_nfc-add-buffer-verification.patch [new file with mode: 0644]
target/linux/ar71xx/patches-3.6/a05-ar934x_nfc-add-buffer-verification.patch [new file with mode: 0644]

index 9434d0fe0610036d6b1c723742483c61fff84da7..7fd04ca62130cf163b4a40bad410692fbad0c695 100644 (file)
@@ -762,18 +762,6 @@ ar934x_nfc_read_buf(struct mtd_info *mtd, u8 *buf, int len)
        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)
 {
@@ -1059,7 +1047,6 @@ ar934x_nfc_probe(struct platform_device *pdev)
        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);
index fad9eacb3bce073f62a68780f5f4511676355d3d..8f7c972fd3ab0cd5fae4340fdaefc76ed078c769 100644 (file)
@@ -1,7 +1,7 @@
 reverted:
 --- a/drivers/mtd/nand/ar934x_nfc.c
 +++ b/drivers/mtd/nand/ar934x_nfc.c
-@@ -1051,6 +1051,7 @@ ar934x_nfc_probe(struct platform_device
+@@ -1039,6 +1039,7 @@ ar934x_nfc_probe(struct platform_device
        else
                mtd->name = dev_name(&pdev->dev);
  
diff --git a/target/linux/ar71xx/patches-3.3/a05-ar934x_nfc-add-buffer-verification.patch b/target/linux/ar71xx/patches-3.3/a05-ar934x_nfc-add-buffer-verification.patch
new file mode 100644 (file)
index 0000000..c4c4628
--- /dev/null
@@ -0,0 +1,29 @@
+--- a/drivers/mtd/nand/ar934x_nfc.c
++++ b/drivers/mtd/nand/ar934x_nfc.c
+@@ -762,6 +762,18 @@ ar934x_nfc_read_buf(struct mtd_info *mtd
+       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)
+ {
+@@ -1048,6 +1060,7 @@ ar934x_nfc_probe(struct platform_device
+       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);
diff --git a/target/linux/ar71xx/patches-3.6/a05-ar934x_nfc-add-buffer-verification.patch b/target/linux/ar71xx/patches-3.6/a05-ar934x_nfc-add-buffer-verification.patch
new file mode 100644 (file)
index 0000000..c4c4628
--- /dev/null
@@ -0,0 +1,29 @@
+--- a/drivers/mtd/nand/ar934x_nfc.c
++++ b/drivers/mtd/nand/ar934x_nfc.c
+@@ -762,6 +762,18 @@ ar934x_nfc_read_buf(struct mtd_info *mtd
+       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)
+ {
+@@ -1048,6 +1060,7 @@ ar934x_nfc_probe(struct platform_device
+       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);