aboutsummaryrefslogtreecommitdiff
path: root/drivers/mtd/nand/nand_base.c
diff options
context:
space:
mode:
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);