Merge tag 'riscv-for-linus-5.14-mw0' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / drivers / block / ataflop.c
index d601e49..a093644 100644 (file)
@@ -1968,22 +1968,14 @@ static const struct blk_mq_ops ataflop_mq_ops = {
 static int ataflop_alloc_disk(unsigned int drive, unsigned int type)
 {
        struct gendisk *disk;
-       int ret;
-
-       disk = alloc_disk(1);
-       if (!disk)
-               return -ENOMEM;
 
-       disk->queue = blk_mq_init_queue(&unit[drive].tag_set);
-       if (IS_ERR(disk->queue)) {
-               ret = PTR_ERR(disk->queue);
-               disk->queue = NULL;
-               put_disk(disk);
-               return ret;
-       }
+       disk = blk_mq_alloc_disk(&unit[drive].tag_set, NULL);
+       if (IS_ERR(disk))
+               return PTR_ERR(disk);
 
        disk->major = FLOPPY_MAJOR;
        disk->first_minor = drive + (type << 2);
+       disk->minors = 1;
        sprintf(disk->disk_name, "fd%d", drive);
        disk->fops = &floppy_fops;
        disk->events = DISK_EVENT_MEDIA_CHANGE;