diff options
-rw-r--r-- | drivers/mtd/chips/cfi_cmdset_0001.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c index 920b474a5613..bfee5b3a9217 100644 --- a/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/drivers/mtd/chips/cfi_cmdset_0001.c | |||
@@ -1017,8 +1017,6 @@ static void put_chip(struct map_info *map, struct flchip *chip, unsigned long ad | |||
1017 | case FL_READY: | 1017 | case FL_READY: |
1018 | case FL_STATUS: | 1018 | case FL_STATUS: |
1019 | case FL_JEDEC_QUERY: | 1019 | case FL_JEDEC_QUERY: |
1020 | /* We should really make set_vpp() count, rather than doing this */ | ||
1021 | DISABLE_VPP(map); | ||
1022 | break; | 1020 | break; |
1023 | default: | 1021 | default: |
1024 | printk(KERN_ERR "%s: put_chip() called with oldstate %d!!\n", map->name, chip->oldstate); | 1022 | printk(KERN_ERR "%s: put_chip() called with oldstate %d!!\n", map->name, chip->oldstate); |
@@ -1552,7 +1550,8 @@ static int __xipram do_write_oneword(struct map_info *map, struct flchip *chip, | |||
1552 | } | 1550 | } |
1553 | 1551 | ||
1554 | xip_enable(map, chip, adr); | 1552 | xip_enable(map, chip, adr); |
1555 | out: put_chip(map, chip, adr); | 1553 | out: DISABLE_VPP(map); |
1554 | put_chip(map, chip, adr); | ||
1556 | mutex_unlock(&chip->mutex); | 1555 | mutex_unlock(&chip->mutex); |
1557 | return ret; | 1556 | return ret; |
1558 | } | 1557 | } |
@@ -1791,7 +1790,8 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, | |||
1791 | } | 1790 | } |
1792 | 1791 | ||
1793 | xip_enable(map, chip, cmd_adr); | 1792 | xip_enable(map, chip, cmd_adr); |
1794 | out: put_chip(map, chip, cmd_adr); | 1793 | out: DISABLE_VPP(map); |
1794 | put_chip(map, chip, cmd_adr); | ||
1795 | mutex_unlock(&chip->mutex); | 1795 | mutex_unlock(&chip->mutex); |
1796 | return ret; | 1796 | return ret; |
1797 | } | 1797 | } |
@@ -1928,6 +1928,7 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip, | |||
1928 | ret = -EIO; | 1928 | ret = -EIO; |
1929 | } else if (chipstatus & 0x20 && retries--) { | 1929 | } else if (chipstatus & 0x20 && retries--) { |
1930 | printk(KERN_DEBUG "block erase failed at 0x%08lx: status 0x%lx. Retrying...\n", adr, chipstatus); | 1930 | printk(KERN_DEBUG "block erase failed at 0x%08lx: status 0x%lx. Retrying...\n", adr, chipstatus); |
1931 | DISABLE_VPP(map); | ||
1931 | put_chip(map, chip, adr); | 1932 | put_chip(map, chip, adr); |
1932 | mutex_unlock(&chip->mutex); | 1933 | mutex_unlock(&chip->mutex); |
1933 | goto retry; | 1934 | goto retry; |
@@ -1940,7 +1941,8 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip, | |||
1940 | } | 1941 | } |
1941 | 1942 | ||
1942 | xip_enable(map, chip, adr); | 1943 | xip_enable(map, chip, adr); |
1943 | out: put_chip(map, chip, adr); | 1944 | out: DISABLE_VPP(map); |
1945 | put_chip(map, chip, adr); | ||
1944 | mutex_unlock(&chip->mutex); | 1946 | mutex_unlock(&chip->mutex); |
1945 | return ret; | 1947 | return ret; |
1946 | } | 1948 | } |
@@ -2082,7 +2084,8 @@ static int __xipram do_xxlock_oneblock(struct map_info *map, struct flchip *chip | |||
2082 | } | 2084 | } |
2083 | 2085 | ||
2084 | xip_enable(map, chip, adr); | 2086 | xip_enable(map, chip, adr); |
2085 | out: put_chip(map, chip, adr); | 2087 | out: DISABLE_VPP(map); |
2088 | put_chip(map, chip, adr); | ||
2086 | mutex_unlock(&chip->mutex); | 2089 | mutex_unlock(&chip->mutex); |
2087 | return ret; | 2090 | return ret; |
2088 | } | 2091 | } |