* [PATCH] [MTD] m25p80.c erase enhance (v2)
@ 2008-10-21 3:15 Chen Gong
2008-10-21 4:20 ` David Brownell
0 siblings, 1 reply; 2+ messages in thread
From: Chen Gong @ 2008-10-21 3:15 UTC (permalink / raw)
To: linux-mtd; +Cc: david-b, Chen Gong, Chen Gong, dwmw2
To avoid confusion, according to the suggestion from
David Brownell <david-b@pacbell.net>, cleanup some
terminology as follows:
OPCODE_BE ==> OPCODE_CHIP_ERASE
erase_block ==> erase_chip
Signed-Off-by: Chen Gong <clumsycg@gmail.com>
---
drivers/mtd/devices/m25p80.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 76a7675..b95aadf 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -39,7 +39,7 @@
#define OPCODE_PP 0x02 /* Page program (up to 256 bytes) */
#define OPCODE_BE_4K 0x20 /* Erase 4KiB block */
#define OPCODE_BE_32K 0x52 /* Erase 32KiB block */
-#define OPCODE_BE 0xc7 /* Erase whole flash block */
+#define OPCODE_CHIP_ERASE 0xc7 /* Erase whole flash block */
#define OPCODE_SE 0xd8 /* Sector erase (usually 64KiB) */
#define OPCODE_RDID 0x9f /* Read JEDEC ID */
@@ -167,7 +167,7 @@ static int wait_till_ready(struct m25p *flash)
*
* Returns 0 if successful, non-zero otherwise.
*/
-static int erase_block(struct m25p *flash)
+static int erase_chip(struct m25p *flash)
{
DEBUG(MTD_DEBUG_LEVEL3, "%s: %s %dKiB\n",
flash->spi->dev.bus_id, __func__,
@@ -181,7 +181,7 @@ static int erase_block(struct m25p *flash)
write_enable(flash);
/* Set up command buffer. */
- flash->command[0] = OPCODE_BE;
+ flash->command[0] = OPCODE_CHIP_ERASE;
spi_write(flash->spi, flash->command, 1);
@@ -255,7 +255,7 @@ static int m25p80_erase(struct mtd_info *mtd, struct erase_info *instr)
*/
/* now erase those sectors */
- if (len == flash->mtd.size && erase_block(flash)) {
+ if (len == flash->mtd.size && erase_chip(flash)) {
instr->state = MTD_ERASE_FAILED;
mutex_unlock(&flash->lock);
return -EIO;
--
1.5.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] [MTD] m25p80.c erase enhance (v2)
2008-10-21 3:15 [PATCH] [MTD] m25p80.c erase enhance (v2) Chen Gong
@ 2008-10-21 4:20 ` David Brownell
0 siblings, 0 replies; 2+ messages in thread
From: David Brownell @ 2008-10-21 4:20 UTC (permalink / raw)
To: Chen Gong; +Cc: dwmw2, linux-mtd, Chen Gong
On Monday 20 October 2008, Chen Gong wrote:
> -#define OPCODE_BE 0xc7 /* Erase whole flash block */
> +#define OPCODE_CHIP_ERASE 0xc7 /* Erase whole flash block */
Looks good to me, except that comment should be "Erase whole flash chip". :)
Thanks.
- Dave
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-10-21 4:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-21 3:15 [PATCH] [MTD] m25p80.c erase enhance (v2) Chen Gong
2008-10-21 4:20 ` David Brownell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox