diff options
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 7 | ||||
-rw-r--r-- | drivers/mtd/nand/ndfc.c | 6 |
2 files changed, 9 insertions, 4 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); |
diff --git a/drivers/mtd/nand/ndfc.c b/drivers/mtd/nand/ndfc.c index 481541a683ca..4d70dd16cf5d 100644 --- a/drivers/mtd/nand/ndfc.c +++ b/drivers/mtd/nand/ndfc.c | |||
@@ -293,8 +293,12 @@ static struct platform_driver ndfc_nand_driver = { | |||
293 | 293 | ||
294 | static int __init ndfc_nand_init(void) | 294 | static int __init ndfc_nand_init(void) |
295 | { | 295 | { |
296 | int ret = platform_driver_register(&ndfc_nand_driver); | 296 | int ret; |
297 | 297 | ||
298 | spin_lock_init(&ndfc_ctrl.ndfc_control.lock); | ||
299 | init_waitqueue_head(&ndfc_ctrl.ndfc_control.wq); | ||
300 | |||
301 | ret = platform_driver_register(&ndfc_nand_driver); | ||
298 | if (!ret) | 302 | if (!ret) |
299 | ret = platform_driver_register(&ndfc_chip_driver); | 303 | ret = platform_driver_register(&ndfc_chip_driver); |
300 | return ret; | 304 | return ret; |