mtd: change struct flchip_shared spinlock locking into mutex
[linux-2.6.git] / include / linux / mtd / flashchip.h
index d4f38c5..23cc10f 100644 (file)
@@ -15,6 +15,7 @@
  * has asm/spinlock.h, or 2.4, which has linux/spinlock.h
  */
 #include <linux/sched.h>
+#include <linux/mutex.h>
 
 typedef enum {
        FL_READY,
@@ -38,6 +39,15 @@ typedef enum {
        FL_XIP_WHILE_ERASING,
        FL_XIP_WHILE_WRITING,
        FL_SHUTDOWN,
+       /* These 2 come from nand_state_t, which has been unified here */
+       FL_READING,
+       FL_CACHEDPRG,
+       /* These 4 come from onenand_state_t, which has been unified here */
+       FL_RESETING,
+       FL_OTPING,
+       FL_PREPARING_ERASE,
+       FL_VERIFYING_ERASE,
+
        FL_UNKNOWN
 } flstate_t;
 
@@ -65,8 +75,7 @@ struct flchip {
        unsigned int erase_suspended:1;
        unsigned long in_progress_block_addr;
 
-       spinlock_t *mutex;
-       spinlock_t _spinlock; /* We do it like this because sometimes they'll be shared. */
+       struct mutex mutex;
        wait_queue_head_t wq; /* Wait on here when we're waiting for the chip
                             to be ready */
        int word_write_time;
@@ -83,7 +92,7 @@ struct flchip {
 /* This is used to handle contention on write/erase operations
    between partitions of the same physical chip. */
 struct flchip_shared {
-       spinlock_t lock;
+       struct mutex lock;
        struct flchip *writing;
        struct flchip *erasing;
 };