diff options
author | David A. Marlin <dmarlin@redhat.com> | 2005-01-23 13:30:53 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@mtd.linutronix.de> | 2005-05-23 05:32:36 -0400 |
commit | a4ab4c5d32b66a440fb2e00f975f919f559f001d (patch) | |
tree | 15687db56486438db6cd3c6f25a9434bc11d1549 /drivers/mtd/nand/nand_base.c | |
parent | 7ba48c4583f7da5b05cf9859337195323df67b6d (diff) |
[MTD] NAND use symbols instead of literals
Replace some literals with defined symbols.
Signed-off-by: David A. Marlin <dmarlin@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/mtd/nand/nand_base.c')
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 68a6014f5560..9f7c42ceecfa 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -55,7 +55,7 @@ | |||
55 | * The AG-AND chips have nice features for speed improvement, | 55 | * The AG-AND chips have nice features for speed improvement, |
56 | * which are not supported yet. Read / program 4 pages in one go. | 56 | * which are not supported yet. Read / program 4 pages in one go. |
57 | * | 57 | * |
58 | * $Id: nand_base.c,v 1.128 2005/01/18 16:14:56 gleixner Exp $ | 58 | * $Id: nand_base.c,v 1.129 2005/01/23 18:30:50 dmarlin Exp $ |
59 | * | 59 | * |
60 | * This program is free software; you can redistribute it and/or modify | 60 | * This program is free software; you can redistribute it and/or modify |
61 | * it under the terms of the GNU General Public License version 2 as | 61 | * 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 | struct nand_chip *this = mtd->priv; | 480 | struct nand_chip *this = mtd->priv; |
481 | /* Check the WP bit */ | 481 | /* Check the WP bit */ |
482 | this->cmdfunc (mtd, NAND_CMD_STATUS, -1, -1); | 482 | this->cmdfunc (mtd, NAND_CMD_STATUS, -1, -1); |
483 | return (this->read_byte(mtd) & 0x80) ? 0 : 1; | 483 | return (this->read_byte(mtd) & NAND_STATUS_WP) ? 0 : 1; |
484 | } | 484 | } |
485 | 485 | ||
486 | /** | 486 | /** |
@@ -585,7 +585,7 @@ static void nand_command (struct mtd_info *mtd, unsigned command, int column, in | |||
585 | this->hwcontrol(mtd, NAND_CTL_SETCLE); | 585 | this->hwcontrol(mtd, NAND_CTL_SETCLE); |
586 | this->write_byte(mtd, NAND_CMD_STATUS); | 586 | this->write_byte(mtd, NAND_CMD_STATUS); |
587 | this->hwcontrol(mtd, NAND_CTL_CLRCLE); | 587 | this->hwcontrol(mtd, NAND_CTL_CLRCLE); |
588 | while ( !(this->read_byte(mtd) & 0x40)); | 588 | while ( !(this->read_byte(mtd) & NAND_STATUS_READY)); |
589 | return; | 589 | return; |
590 | 590 | ||
591 | /* This applies to read commands */ | 591 | /* This applies to read commands */ |
@@ -692,7 +692,7 @@ static void nand_command_lp (struct mtd_info *mtd, unsigned command, int column, | |||
692 | this->hwcontrol(mtd, NAND_CTL_SETCLE); | 692 | this->hwcontrol(mtd, NAND_CTL_SETCLE); |
693 | this->write_byte(mtd, NAND_CMD_STATUS); | 693 | this->write_byte(mtd, NAND_CMD_STATUS); |
694 | this->hwcontrol(mtd, NAND_CTL_CLRCLE); | 694 | this->hwcontrol(mtd, NAND_CTL_CLRCLE); |
695 | while ( !(this->read_byte(mtd) & 0x40)); | 695 | while ( !(this->read_byte(mtd) & NAND_STATUS_READY)); |
696 | return; | 696 | return; |
697 | 697 | ||
698 | case NAND_CMD_READ0: | 698 | case NAND_CMD_READ0: |
@@ -897,7 +897,7 @@ static int nand_write_page (struct mtd_info *mtd, struct nand_chip *this, int pa | |||
897 | /* call wait ready function */ | 897 | /* call wait ready function */ |
898 | status = this->waitfunc (mtd, this, FL_WRITING); | 898 | status = this->waitfunc (mtd, this, FL_WRITING); |
899 | /* See if device thinks it succeeded */ | 899 | /* See if device thinks it succeeded */ |
900 | if (status & 0x01) { | 900 | if (status & NAND_STATUS_FAIL) { |
901 | DEBUG (MTD_DEBUG_LEVEL0, "%s: " "Failed write, page 0x%08x, ", __FUNCTION__, page); | 901 | DEBUG (MTD_DEBUG_LEVEL0, "%s: " "Failed write, page 0x%08x, ", __FUNCTION__, page); |
902 | return -EIO; | 902 | return -EIO; |
903 | } | 903 | } |
@@ -1758,7 +1758,7 @@ static int nand_write_oob (struct mtd_info *mtd, loff_t to, size_t len, size_t * | |||
1758 | status = this->waitfunc (mtd, this, FL_WRITING); | 1758 | status = this->waitfunc (mtd, this, FL_WRITING); |
1759 | 1759 | ||
1760 | /* See if device thinks it succeeded */ | 1760 | /* See if device thinks it succeeded */ |
1761 | if (status & 0x01) { | 1761 | if (status & NAND_STATUS_FAIL) { |
1762 | DEBUG (MTD_DEBUG_LEVEL0, "nand_write_oob: " "Failed write, page 0x%08x\n", page); | 1762 | DEBUG (MTD_DEBUG_LEVEL0, "nand_write_oob: " "Failed write, page 0x%08x\n", page); |
1763 | ret = -EIO; | 1763 | ret = -EIO; |
1764 | goto out; | 1764 | goto out; |
@@ -2104,7 +2104,7 @@ int nand_erase_nand (struct mtd_info *mtd, struct erase_info *instr, int allowbb | |||
2104 | status = this->waitfunc (mtd, this, FL_ERASING); | 2104 | status = this->waitfunc (mtd, this, FL_ERASING); |
2105 | 2105 | ||
2106 | /* See if block erase succeeded */ | 2106 | /* See if block erase succeeded */ |
2107 | if (status & 0x01) { | 2107 | if (status & NAND_STATUS_FAIL) { |
2108 | DEBUG (MTD_DEBUG_LEVEL0, "nand_erase: " "Failed erase, page 0x%08x\n", page); | 2108 | DEBUG (MTD_DEBUG_LEVEL0, "nand_erase: " "Failed erase, page 0x%08x\n", page); |
2109 | instr->state = MTD_ERASE_FAILED; | 2109 | instr->state = MTD_ERASE_FAILED; |
2110 | instr->fail_addr = (page << this->page_shift); | 2110 | instr->fail_addr = (page << this->page_shift); |