aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mtd/mtd_blkdevs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index a6bb5863e8f3..89e07e5af577 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -410,13 +410,14 @@ int del_mtd_blktrans_dev(struct mtd_blktrans_dev *old)
410 BUG(); 410 BUG();
411 } 411 }
412 412
413 /* Stop new requests to arrive */
414 del_gendisk(old->disk);
415
416 if (old->disk_attributes) 413 if (old->disk_attributes)
417 sysfs_remove_group(&disk_to_dev(old->disk)->kobj, 414 sysfs_remove_group(&disk_to_dev(old->disk)->kobj,
418 old->disk_attributes); 415 old->disk_attributes);
419 416
417 /* Stop new requests to arrive */
418 del_gendisk(old->disk);
419
420
420 /* Stop the thread */ 421 /* Stop the thread */
421 kthread_stop(old->thread); 422 kthread_stop(old->thread);
422 423