diff options
-rw-r--r-- | drivers/block/floppy.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 17c675c52295..83112f08a41d 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -4137,6 +4137,10 @@ static int __init do_floppy_init(void) | |||
4137 | 4137 | ||
4138 | raw_cmd = NULL; | 4138 | raw_cmd = NULL; |
4139 | 4139 | ||
4140 | floppy_wq = alloc_ordered_workqueue("floppy", 0); | ||
4141 | if (!floppy_wq) | ||
4142 | return -ENOMEM; | ||
4143 | |||
4140 | for (dr = 0; dr < N_DRIVE; dr++) { | 4144 | for (dr = 0; dr < N_DRIVE; dr++) { |
4141 | disks[dr] = alloc_disk(1); | 4145 | disks[dr] = alloc_disk(1); |
4142 | if (!disks[dr]) { | 4146 | if (!disks[dr]) { |
@@ -4144,16 +4148,10 @@ static int __init do_floppy_init(void) | |||
4144 | goto out_put_disk; | 4148 | goto out_put_disk; |
4145 | } | 4149 | } |
4146 | 4150 | ||
4147 | floppy_wq = alloc_ordered_workqueue("floppy", 0); | ||
4148 | if (!floppy_wq) { | ||
4149 | err = -ENOMEM; | ||
4150 | goto out_put_disk; | ||
4151 | } | ||
4152 | |||
4153 | disks[dr]->queue = blk_init_queue(do_fd_request, &floppy_lock); | 4151 | disks[dr]->queue = blk_init_queue(do_fd_request, &floppy_lock); |
4154 | if (!disks[dr]->queue) { | 4152 | if (!disks[dr]->queue) { |
4155 | err = -ENOMEM; | 4153 | err = -ENOMEM; |
4156 | goto out_destroy_workq; | 4154 | goto out_put_disk; |
4157 | } | 4155 | } |
4158 | 4156 | ||
4159 | blk_queue_max_hw_sectors(disks[dr]->queue, 64); | 4157 | blk_queue_max_hw_sectors(disks[dr]->queue, 64); |
@@ -4317,8 +4315,6 @@ out_release_dma: | |||
4317 | out_unreg_region: | 4315 | out_unreg_region: |
4318 | blk_unregister_region(MKDEV(FLOPPY_MAJOR, 0), 256); | 4316 | blk_unregister_region(MKDEV(FLOPPY_MAJOR, 0), 256); |
4319 | platform_driver_unregister(&floppy_driver); | 4317 | platform_driver_unregister(&floppy_driver); |
4320 | out_destroy_workq: | ||
4321 | destroy_workqueue(floppy_wq); | ||
4322 | out_unreg_blkdev: | 4318 | out_unreg_blkdev: |
4323 | unregister_blkdev(FLOPPY_MAJOR, "fd"); | 4319 | unregister_blkdev(FLOPPY_MAJOR, "fd"); |
4324 | out_put_disk: | 4320 | out_put_disk: |
@@ -4334,6 +4330,7 @@ out_put_disk: | |||
4334 | } | 4330 | } |
4335 | put_disk(disks[dr]); | 4331 | put_disk(disks[dr]); |
4336 | } | 4332 | } |
4333 | destroy_workqueue(floppy_wq); | ||
4337 | return err; | 4334 | return err; |
4338 | } | 4335 | } |
4339 | 4336 | ||