diff options
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 724cb2c9ad3f..8f2958fe2148 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -740,8 +740,14 @@ nand_get_device(struct nand_chip *chip, struct mtd_info *mtd, int new_state) | |||
740 | return 0; | 740 | return 0; |
741 | } | 741 | } |
742 | if (new_state == FL_PM_SUSPENDED) { | 742 | if (new_state == FL_PM_SUSPENDED) { |
743 | spin_unlock(lock); | 743 | if (chip->controller->active->state == FL_PM_SUSPENDED) { |
744 | return (chip->state == FL_PM_SUSPENDED) ? 0 : -EAGAIN; | 744 | chip->state = FL_PM_SUSPENDED; |
745 | spin_unlock(lock); | ||
746 | return 0; | ||
747 | } else { | ||
748 | spin_unlock(lock); | ||
749 | return -EAGAIN; | ||
750 | } | ||
745 | } | 751 | } |
746 | set_current_state(TASK_UNINTERRUPTIBLE); | 752 | set_current_state(TASK_UNINTERRUPTIBLE); |
747 | add_wait_queue(wq, &wait); | 753 | add_wait_queue(wq, &wait); |