Patchwork mtd: remove duplicate assignment of chip->state

login
register
mail settings
Submitter Tadashi Abe
Date May 19, 2011, 7:17 a.m.
Message ID <4DD4C41E.9020807@mvista.com>
Download mbox | patch
Permalink /patch/96322/
State Accepted
Commit 5c8d2607756a63ddf5b2f2dd368851b8febe4e72
Headers show

Comments

Tadashi Abe - May 19, 2011, 7:17 a.m.
This is a trivial patch which removes unnecessary assignment of chip->state
in put_chip(). It's duplicated.

Signed-off-by: Tadashi Abe <tabe@mvista.com>

---
 drivers/mtd/chips/cfi_cmdset_0001.c |    1 -
 drivers/mtd/chips/cfi_cmdset_0002.c |    1 -
 drivers/mtd/lpddr/lpddr_cmds.c      |    1 -
 3 files changed, 0 insertions(+), 3 deletions(-)
Joakim Tjernlund - May 19, 2011, 4:35 p.m.
> From: Tadashi Abe <tabe@mvista.com>
>
> This is a trivial patch which removes unnecessary assignment of chip->state
> in put_chip(). It's duplicated.
>
> Signed-off-by: Tadashi Abe <tabe@mvista.com>

Looks good for cfi_cmdset_0001.c:

Acked-by: Joakim Tjernlund <joakim.tjernlund@transmode.se>

Patch

diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
index 09cb7c8..308709a 100644
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -997,7 +997,6 @@  static void put_chip(struct map_info *map, struct flchip *chip, unsigned long ad
 
 	switch(chip->oldstate) {
 	case FL_ERASING:
-		chip->state = chip->oldstate;
 		/* What if one interleaved chip has finished and the
 		   other hasn't? The old code would leave the finished
 		   one in READY mode. That's bad, and caused -EROFS
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index 0b49266..6d55281 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -762,7 +762,6 @@  static void put_chip(struct map_info *map, struct flchip *chip, unsigned long ad
 
 	switch(chip->oldstate) {
 	case FL_ERASING:
-		chip->state = chip->oldstate;
 		map_write(map, cfi->sector_erase_cmd, chip->in_progress_block_addr);
 		chip->oldstate = FL_READY;
 		chip->state = FL_ERASING;
diff --git a/drivers/mtd/lpddr/lpddr_cmds.c b/drivers/mtd/lpddr/lpddr_cmds.c
index 1267992..c8f79c7 100644
--- a/drivers/mtd/lpddr/lpddr_cmds.c
+++ b/drivers/mtd/lpddr/lpddr_cmds.c
@@ -383,7 +383,6 @@  static void put_chip(struct map_info *map, struct flchip *chip)
 
 	switch (chip->oldstate) {
 	case FL_ERASING:
-		chip->state = chip->oldstate;
 		map_write(map, CMD(LPDDR_RESUME),
 				map->pfow_base + PFOW_COMMAND_CODE);
 		map_write(map, CMD(LPDDR_START_EXECUTION),