Commit a4ab4c5d authored by David A. Marlin's avatar David A. Marlin Committed by Thomas Gleixner

[MTD] NAND use symbols instead of literals

Replace some literals with defined symbols.
Signed-off-by: default avatarDavid A. Marlin <dmarlin@redhat.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 7ba48c45
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
* The AG-AND chips have nice features for speed improvement, * The AG-AND chips have nice features for speed improvement,
* which are not supported yet. Read / program 4 pages in one go. * which are not supported yet. Read / program 4 pages in one go.
* *
* $Id: nand_base.c,v 1.128 2005/01/18 16:14:56 gleixner Exp $ * $Id: nand_base.c,v 1.129 2005/01/23 18:30:50 dmarlin Exp $
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
...@@ -480,7 +480,7 @@ static int nand_check_wp (struct mtd_info *mtd) ...@@ -480,7 +480,7 @@ static int nand_check_wp (struct mtd_info *mtd)
struct nand_chip *this = mtd->priv; struct nand_chip *this = mtd->priv;
/* Check the WP bit */ /* Check the WP bit */
this->cmdfunc (mtd, NAND_CMD_STATUS, -1, -1); this->cmdfunc (mtd, NAND_CMD_STATUS, -1, -1);
return (this->read_byte(mtd) & 0x80) ? 0 : 1; return (this->read_byte(mtd) & NAND_STATUS_WP) ? 0 : 1;
} }
/** /**
...@@ -585,7 +585,7 @@ static void nand_command (struct mtd_info *mtd, unsigned command, int column, in ...@@ -585,7 +585,7 @@ static void nand_command (struct mtd_info *mtd, unsigned command, int column, in
this->hwcontrol(mtd, NAND_CTL_SETCLE); this->hwcontrol(mtd, NAND_CTL_SETCLE);
this->write_byte(mtd, NAND_CMD_STATUS); this->write_byte(mtd, NAND_CMD_STATUS);
this->hwcontrol(mtd, NAND_CTL_CLRCLE); this->hwcontrol(mtd, NAND_CTL_CLRCLE);
while ( !(this->read_byte(mtd) & 0x40)); while ( !(this->read_byte(mtd) & NAND_STATUS_READY));
return; return;
/* This applies to read commands */ /* This applies to read commands */
...@@ -692,7 +692,7 @@ static void nand_command_lp (struct mtd_info *mtd, unsigned command, int column, ...@@ -692,7 +692,7 @@ static void nand_command_lp (struct mtd_info *mtd, unsigned command, int column,
this->hwcontrol(mtd, NAND_CTL_SETCLE); this->hwcontrol(mtd, NAND_CTL_SETCLE);
this->write_byte(mtd, NAND_CMD_STATUS); this->write_byte(mtd, NAND_CMD_STATUS);
this->hwcontrol(mtd, NAND_CTL_CLRCLE); this->hwcontrol(mtd, NAND_CTL_CLRCLE);
while ( !(this->read_byte(mtd) & 0x40)); while ( !(this->read_byte(mtd) & NAND_STATUS_READY));
return; return;
case NAND_CMD_READ0: case NAND_CMD_READ0:
...@@ -897,7 +897,7 @@ static int nand_write_page (struct mtd_info *mtd, struct nand_chip *this, int pa ...@@ -897,7 +897,7 @@ static int nand_write_page (struct mtd_info *mtd, struct nand_chip *this, int pa
/* call wait ready function */ /* call wait ready function */
status = this->waitfunc (mtd, this, FL_WRITING); status = this->waitfunc (mtd, this, FL_WRITING);
/* See if device thinks it succeeded */ /* See if device thinks it succeeded */
if (status & 0x01) { if (status & NAND_STATUS_FAIL) {
DEBUG (MTD_DEBUG_LEVEL0, "%s: " "Failed write, page 0x%08x, ", __FUNCTION__, page); DEBUG (MTD_DEBUG_LEVEL0, "%s: " "Failed write, page 0x%08x, ", __FUNCTION__, page);
return -EIO; return -EIO;
} }
...@@ -1758,7 +1758,7 @@ static int nand_write_oob (struct mtd_info *mtd, loff_t to, size_t len, size_t * ...@@ -1758,7 +1758,7 @@ static int nand_write_oob (struct mtd_info *mtd, loff_t to, size_t len, size_t *
status = this->waitfunc (mtd, this, FL_WRITING); status = this->waitfunc (mtd, this, FL_WRITING);
/* See if device thinks it succeeded */ /* See if device thinks it succeeded */
if (status & 0x01) { if (status & NAND_STATUS_FAIL) {
DEBUG (MTD_DEBUG_LEVEL0, "nand_write_oob: " "Failed write, page 0x%08x\n", page); DEBUG (MTD_DEBUG_LEVEL0, "nand_write_oob: " "Failed write, page 0x%08x\n", page);
ret = -EIO; ret = -EIO;
goto out; goto out;
...@@ -2104,7 +2104,7 @@ int nand_erase_nand (struct mtd_info *mtd, struct erase_info *instr, int allowbb ...@@ -2104,7 +2104,7 @@ int nand_erase_nand (struct mtd_info *mtd, struct erase_info *instr, int allowbb
status = this->waitfunc (mtd, this, FL_ERASING); status = this->waitfunc (mtd, this, FL_ERASING);
/* See if block erase succeeded */ /* See if block erase succeeded */
if (status & 0x01) { if (status & NAND_STATUS_FAIL) {
DEBUG (MTD_DEBUG_LEVEL0, "nand_erase: " "Failed erase, page 0x%08x\n", page); DEBUG (MTD_DEBUG_LEVEL0, "nand_erase: " "Failed erase, page 0x%08x\n", page);
instr->state = MTD_ERASE_FAILED; instr->state = MTD_ERASE_FAILED;
instr->fail_addr = (page << this->page_shift); instr->fail_addr = (page << this->page_shift);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment