[LEDE-DEV] [PATCH] ar71xx: fix drivers/mtd/nand/ar934x_nfc.c
p.wassi at gmx.at
p.wassi at gmx.at
Tue Nov 15 22:25:10 PST 2016
From: Paul Wassi <p.wassi at gmx.at>
Fix the incorrect usage of ar934x_nfc_write_page and ar934x_nfc_write_page_raw.
Add *page* in the argument list and remove the local variable.
Signed-off-by: Paul Wassi <p.wassi at gmx.at>
---
In the buildlogs of ar71xx-nand [1] you can see a warning
> drivers/mtd/nand/ar934x_nfc.c: In function 'ar934x_nfc_setup_hwecc':
> drivers/mtd/nand/ar934x_nfc.c:1328:23: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
> nand->ecc.write_page = ar934x_nfc_write_page;
> ^
> drivers/mtd/nand/ar934x_nfc.c:1329:27: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
> nand->ecc.write_page_raw = ar934x_nfc_write_page_raw;
> ^
This is due to a change in interfaces which was done by kernel upstream in 2015-10-13
as can be seen in [2]. The function pointers seem to have been used incorrectly since then.
[1]:
http://phase1.builds.lede-project.org/builders/ar71xx%2Fnand/builds/322/steps/images/logs/stdio
[2]:
https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/patch/include/linux/mtd/nand.h?id=45aaeff947190e4b57b2d0db4d74ab5eea450825
target/linux/ar71xx/files/drivers/mtd/nand/ar934x_nfc.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/target/linux/ar71xx/files/drivers/mtd/nand/ar934x_nfc.c b/target/linux/ar71xx/files/drivers/mtd/nand/ar934x_nfc.c
--- a/target/linux/ar71xx/files/drivers/mtd/nand/ar934x_nfc.c
+++ b/target/linux/ar71xx/files/drivers/mtd/nand/ar934x_nfc.c
@@ -983,14 +983,11 @@ ar934x_nfc_read_page(struct mtd_info *mtd, struct nand_chip *chip,
static int
ar934x_nfc_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
- const u8 *buf, int oob_required)
+ const u8 *buf, int oob_required, int page)
{
struct ar934x_nfc *nfc = mtd_to_ar934x_nfc(mtd);
- int page;
int len;
- page = nfc->seqin_page_addr;
-
nfc_dbg(nfc, "write_page_raw: page:%d oob:%d\n", page, oob_required);
memcpy(nfc->buf, buf, mtd->writesize);
@@ -1006,14 +1003,11 @@ ar934x_nfc_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
static int
ar934x_nfc_write_page(struct mtd_info *mtd, struct nand_chip *chip,
- const u8 *buf, int oob_required)
+ const u8 *buf, int oob_required, int page)
{
struct ar934x_nfc *nfc = mtd_to_ar934x_nfc(mtd);
- int page;
int err;
- page = nfc->seqin_page_addr;
-
nfc_dbg(nfc, "write_page: page:%d oob:%d\n", page, oob_required);
/* write OOB first */
More information about the Lede-dev
mailing list