Skip to content

Commit d6e5521

Browse files
author
Roger Quadros
committed
mtd: nand: omap: Switch to using GPMC-NAND ops for writebuffer empty check
Instead of accessing the gpmc_status register directly start using the gpmc_nand_ops->nand_writebuffer_empty() helper to check write buffer empty status. Signed-off-by: Roger Quadros <[email protected]> Acked-by: Brian Norris <[email protected]> Acked-by: Tony Lindgren <[email protected]>
1 parent c509aef commit d6e5521

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/mtd/nand/omap2.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,14 +291,13 @@ static void omap_write_buf8(struct mtd_info *mtd, const u_char *buf, int len)
291291
{
292292
struct omap_nand_info *info = mtd_to_omap(mtd);
293293
u_char *p = (u_char *)buf;
294-
u32 status = 0;
294+
bool status;
295295

296296
while (len--) {
297297
iowrite8(*p++, info->nand.IO_ADDR_W);
298298
/* wait until buffer is available for write */
299299
do {
300-
status = readl(info->reg.gpmc_status) &
301-
STATUS_BUFF_EMPTY;
300+
status = info->ops->nand_writebuffer_empty();
302301
} while (!status);
303302
}
304303
}
@@ -326,16 +325,15 @@ static void omap_write_buf16(struct mtd_info *mtd, const u_char * buf, int len)
326325
{
327326
struct omap_nand_info *info = mtd_to_omap(mtd);
328327
u16 *p = (u16 *) buf;
329-
u32 status = 0;
328+
bool status;
330329
/* FIXME try bursts of writesw() or DMA ... */
331330
len >>= 1;
332331

333332
while (len--) {
334333
iowrite16(*p++, info->nand.IO_ADDR_W);
335334
/* wait until buffer is available for write */
336335
do {
337-
status = readl(info->reg.gpmc_status) &
338-
STATUS_BUFF_EMPTY;
336+
status = info->ops->nand_writebuffer_empty();
339337
} while (!status);
340338
}
341339
}

0 commit comments

Comments
 (0)