diff options
Diffstat (limited to 'drivers/mtd/nand/nand_base.c')
| -rw-r--r-- | drivers/mtd/nand/nand_base.c | 7 |
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); |
