aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/nand_base.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@cruncher.tec.linutronix.de>2006-05-25 03:45:29 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2006-05-25 07:45:26 -0400
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 5690de223c11..61b2363f9324 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)
2125 GFP_KERNEL); 2125 GFP_KERNEL);
2126 if (!chip->controller) 2126 if (!chip->controller)
2127 goto outerr; 2127 goto outerr;
2128
2129 spin_lock_init(&chip->controller->lock);
2130 init_waitqueue_head(&chip->controller->wq);
2128 chip->options |= NAND_CONTROLLER_ALLOC; 2131 chip->options |= NAND_CONTROLLER_ALLOC;
2129 } 2132 }
2130 return 0; 2133 return 0;
@@ -2451,10 +2454,8 @@ int nand_scan(struct mtd_info *mtd, int maxchips)
2451 BUG(); 2454 BUG();
2452 } 2455 }
2453 2456
2454 /* Initialize state, waitqueue and spinlock */ 2457 /* Initialize state */
2455 chip->state = FL_READY; 2458 chip->state = FL_READY;
2456 init_waitqueue_head(&chip->controller->wq);
2457 spin_lock_init(&chip->controller->lock);
2458 2459
2459 /* De-select the device */ 2460 /* De-select the device */
2460 chip->select_chip(mtd, -1); 2461 chip->select_chip(mtd, -1);