aboutsummaryrefslogtreecommitdiff
path: root/drivers/mtd/nand/nand_base.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@cruncher.tec.linutronix.de>2006-05-25 09:45:29 +0200
committerDavid Woodhouse <dwmw2@infradead.org>2006-05-25 12:45:26 +0100
commit04bbd0eafb0c733c6c7f5d63c5098c615fe0685a (patch)
treee4bf0095d7a46912d13a1508ba9acd6e39fa3733 /drivers/mtd/nand/nand_base.c
parent8b9e9fe8c6ee354aa75dc5a33e1575b21aa52084 (diff)
[MTD] NAND Initialize controller lock and wq only once
The lock simplifying patch did not move the lock and waitqueue initialization into the controller allocation patch. This reinitializes waitqueue and spinlocks also for driver supplied controller stuctures. Move it into the allocation path. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/mtd/nand/nand_base.c')
-rw-r--r--drivers/mtd/nand/nand_base.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 5690de223c1..61b2363f932 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2125,6 +2125,9 @@ static int nand_allocate_kmem(struct mtd_info *mtd, struct nand_chip *chip)
GFP_KERNEL);
if (!chip->controller)
goto outerr;
+
+ spin_lock_init(&chip->controller->lock);
+ init_waitqueue_head(&chip->controller->wq);
chip->options |= NAND_CONTROLLER_ALLOC;
}
return 0;
@@ -2451,10 +2454,8 @@ int nand_scan(struct mtd_info *mtd, int maxchips)
BUG();
}
- /* Initialize state, waitqueue and spinlock */
+ /* Initialize state */
chip->state = FL_READY;
- init_waitqueue_head(&chip->controller->wq);
- spin_lock_init(&chip->controller->lock);
/* De-select the device */
chip->select_chip(mtd, -1);