diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-04-19 12:17:29 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-04-19 12:17:29 -0400 |
commit | adf6d34e460387ee3e8f1e1875d52bff51212c7d (patch) | |
tree | 88ef100143e6184103a608f82dfd232bf6376eaf /drivers/mtd | |
parent | d1964dab60ce7c104dd21590e987a8787db18051 (diff) | |
parent | 3760d31f11bfbd0ead9eaeb8573e0602437a9d7c (diff) |
Merge branch 'omap2-upstream' into devel
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/chips/cfi_cmdset_0001.c | 10 | ||||
-rw-r--r-- | drivers/mtd/chips/cfi_cmdset_0002.c | 1 | ||||
-rw-r--r-- | drivers/mtd/chips/cfi_cmdset_0020.c | 1 | ||||
-rw-r--r-- | drivers/mtd/maps/physmap.c | 15 | ||||
-rw-r--r-- | drivers/mtd/nand/rtc_from4.c | 2 |
5 files changed, 15 insertions, 14 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c index 47794d23a42e..0080452531d6 100644 --- a/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/drivers/mtd/chips/cfi_cmdset_0001.c | |||
@@ -718,7 +718,7 @@ static int chip_ready (struct map_info *map, struct flchip *chip, unsigned long | |||
718 | /* Someone else might have been playing with it. */ | 718 | /* Someone else might have been playing with it. */ |
719 | return -EAGAIN; | 719 | return -EAGAIN; |
720 | } | 720 | } |
721 | 721 | /* Fall through */ | |
722 | case FL_READY: | 722 | case FL_READY: |
723 | case FL_CFI_QUERY: | 723 | case FL_CFI_QUERY: |
724 | case FL_JEDEC_QUERY: | 724 | case FL_JEDEC_QUERY: |
@@ -778,14 +778,14 @@ static int chip_ready (struct map_info *map, struct flchip *chip, unsigned long | |||
778 | chip->state = FL_READY; | 778 | chip->state = FL_READY; |
779 | return 0; | 779 | return 0; |
780 | 780 | ||
781 | case FL_SHUTDOWN: | ||
782 | /* The machine is rebooting now,so no one can get chip anymore */ | ||
783 | return -EIO; | ||
781 | case FL_POINT: | 784 | case FL_POINT: |
782 | /* Only if there's no operation suspended... */ | 785 | /* Only if there's no operation suspended... */ |
783 | if (mode == FL_READY && chip->oldstate == FL_READY) | 786 | if (mode == FL_READY && chip->oldstate == FL_READY) |
784 | return 0; | 787 | return 0; |
785 | 788 | /* Fall through */ | |
786 | case FL_SHUTDOWN: | ||
787 | /* The machine is rebooting now,so no one can get chip anymore */ | ||
788 | return -EIO; | ||
789 | default: | 789 | default: |
790 | sleep: | 790 | sleep: |
791 | set_current_state(TASK_UNINTERRUPTIBLE); | 791 | set_current_state(TASK_UNINTERRUPTIBLE); |
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index d072e87ce4e2..458d477614d6 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c | |||
@@ -1763,6 +1763,7 @@ static void cfi_amdstd_sync (struct mtd_info *mtd) | |||
1763 | 1763 | ||
1764 | default: | 1764 | default: |
1765 | /* Not an idle state */ | 1765 | /* Not an idle state */ |
1766 | set_current_state(TASK_UNINTERRUPTIBLE); | ||
1766 | add_wait_queue(&chip->wq, &wait); | 1767 | add_wait_queue(&chip->wq, &wait); |
1767 | 1768 | ||
1768 | spin_unlock(chip->mutex); | 1769 | spin_unlock(chip->mutex); |
diff --git a/drivers/mtd/chips/cfi_cmdset_0020.c b/drivers/mtd/chips/cfi_cmdset_0020.c index b344ff858b2d..492e2ab27420 100644 --- a/drivers/mtd/chips/cfi_cmdset_0020.c +++ b/drivers/mtd/chips/cfi_cmdset_0020.c | |||
@@ -1015,6 +1015,7 @@ static void cfi_staa_sync (struct mtd_info *mtd) | |||
1015 | 1015 | ||
1016 | default: | 1016 | default: |
1017 | /* Not an idle state */ | 1017 | /* Not an idle state */ |
1018 | set_current_state(TASK_UNINTERRUPTIBLE); | ||
1018 | add_wait_queue(&chip->wq, &wait); | 1019 | add_wait_queue(&chip->wq, &wait); |
1019 | 1020 | ||
1020 | spin_unlock_bh(chip->mutex); | 1021 | spin_unlock_bh(chip->mutex); |
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c index f00e04efbe28..bc4649a17b9d 100644 --- a/drivers/mtd/maps/physmap.c +++ b/drivers/mtd/maps/physmap.c | |||
@@ -202,9 +202,8 @@ static int physmap_flash_suspend(struct platform_device *dev, pm_message_t state | |||
202 | int ret = 0; | 202 | int ret = 0; |
203 | int i; | 203 | int i; |
204 | 204 | ||
205 | if (info) | 205 | for (i = 0; i < MAX_RESOURCES && info->mtd[i]; i++) |
206 | for (i = 0; i < MAX_RESOURCES; i++) | 206 | ret |= info->mtd[i]->suspend(info->mtd[i]); |
207 | ret |= info->mtd[i]->suspend(info->mtd[i]); | ||
208 | 207 | ||
209 | return ret; | 208 | return ret; |
210 | } | 209 | } |
@@ -214,9 +213,9 @@ static int physmap_flash_resume(struct platform_device *dev) | |||
214 | struct physmap_flash_info *info = platform_get_drvdata(dev); | 213 | struct physmap_flash_info *info = platform_get_drvdata(dev); |
215 | int i; | 214 | int i; |
216 | 215 | ||
217 | if (info) | 216 | for (i = 0; i < MAX_RESOURCES && info->mtd[i]; i++) |
218 | for (i = 0; i < MAX_RESOURCES; i++) | 217 | info->mtd[i]->resume(info->mtd[i]); |
219 | info->mtd[i]->resume(info->mtd[i]); | 218 | |
220 | return 0; | 219 | return 0; |
221 | } | 220 | } |
222 | 221 | ||
@@ -225,8 +224,8 @@ static void physmap_flash_shutdown(struct platform_device *dev) | |||
225 | struct physmap_flash_info *info = platform_get_drvdata(dev); | 224 | struct physmap_flash_info *info = platform_get_drvdata(dev); |
226 | int i; | 225 | int i; |
227 | 226 | ||
228 | for (i = 0; i < MAX_RESOURCES; i++) | 227 | for (i = 0; i < MAX_RESOURCES && info->mtd[i]; i++) |
229 | if (info && info->mtd[i]->suspend(info->mtd[i]) == 0) | 228 | if (info->mtd[i]->suspend(info->mtd[i]) == 0) |
230 | info->mtd[i]->resume(info->mtd[i]); | 229 | info->mtd[i]->resume(info->mtd[i]); |
231 | } | 230 | } |
232 | #else | 231 | #else |
diff --git a/drivers/mtd/nand/rtc_from4.c b/drivers/mtd/nand/rtc_from4.c index 9189ec8f243e..0f6ac250f434 100644 --- a/drivers/mtd/nand/rtc_from4.c +++ b/drivers/mtd/nand/rtc_from4.c | |||
@@ -460,7 +460,7 @@ static int rtc_from4_errstat(struct mtd_info *mtd, struct nand_chip *this, | |||
460 | er_stat |= 1 << 1; | 460 | er_stat |= 1 << 1; |
461 | kfree(buf); | 461 | kfree(buf); |
462 | } | 462 | } |
463 | 463 | out: | |
464 | rtn = status; | 464 | rtn = status; |
465 | if (er_stat == 0) { /* if ECC is available */ | 465 | if (er_stat == 0) { /* if ECC is available */ |
466 | rtn = (status & ~NAND_STATUS_FAIL); /* clear the error bit */ | 466 | rtn = (status & ~NAND_STATUS_FAIL); /* clear the error bit */ |