Skip to content

Commit df8fed8

Browse files
paulburtonmiquelraynal
authored andcommitted
mtd: rawnand: au1550nd: Fix au_read_buf16() prototype
Commit 7e53432 ("mtd: rawnand: Pass a nand_chip object to chip->read_xxx() hooks") modified the prototype of the struct nand_chip read_buf function pointer. In the au1550nd driver we have 2 implementations of read_buf. The previously mentioned commit modified the au_read_buf() implementation to match the function pointer, but not au_read_buf16(). This results in a compiler warning for MIPS db1xxx_defconfig builds: drivers/mtd/nand/raw/au1550nd.c:443:57: warning: pointer type mismatch in conditional expression Fix this by updating the prototype of au_read_buf16() to take a struct nand_chip pointer as its first argument, as is expected after commit 7e53432 ("mtd: rawnand: Pass a nand_chip object to chip->read_xxx() hooks"). Note that this shouldn't have caused any functional issues at runtime, since the offset of the struct mtd_info within struct nand_chip is 0 making mtd_to_nand() effectively a type-cast. Signed-off-by: Paul Burton <[email protected]> Fixes: 7e53432 ("mtd: rawnand: Pass a nand_chip object to chip->read_xxx() hooks") Cc: [email protected] # v4.20+ Reviewed-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
1 parent 41e086e commit df8fed8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/mtd/nand/raw/au1550nd.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,15 @@ static void au_write_buf16(struct nand_chip *this, const u_char *buf, int len)
134134

135135
/**
136136
* au_read_buf16 - read chip data into buffer
137-
* @mtd: MTD device structure
137+
* @this: NAND chip object
138138
* @buf: buffer to store date
139139
* @len: number of bytes to read
140140
*
141141
* read function for 16bit buswidth
142142
*/
143-
static void au_read_buf16(struct mtd_info *mtd, u_char *buf, int len)
143+
static void au_read_buf16(struct nand_chip *this, u_char *buf, int len)
144144
{
145145
int i;
146-
struct nand_chip *this = mtd_to_nand(mtd);
147146
u16 *p = (u16 *) buf;
148147
len >>= 1;
149148

0 commit comments

Comments
 (0)