]> www.infradead.org Git - users/hch/block.git/commitdiff
n64cart: convert to blk_alloc_disk
authorChristoph Hellwig <hch@lst.de>
Thu, 29 Apr 2021 14:58:13 +0000 (16:58 +0200)
committerChristoph Hellwig <hch@lst.de>
Thu, 20 May 2021 16:44:38 +0000 (18:44 +0200)
Convert the n64cart driver to use the blk_alloc_disk helper to simplify
gendisk and request_queue allocation.

Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/block/n64cart.c

index 3dae4b631dea600506f7bb85f0cdc0f099a4f1c0..7b4dd10af9ec528021af6781d82fca5b1aecd686 100644 (file)
@@ -132,14 +132,10 @@ static int __init n64cart_probe(struct platform_device *pdev)
        if (!reg_base)
                return -EINVAL;
 
-       disk = alloc_disk(0);
+       disk = blk_alloc_disk(NUMA_NO_NODE);
        if (!disk)
                return -ENOMEM;
 
-       disk->queue = blk_alloc_queue(NUMA_NO_NODE);
-       if (!disk->queue)
-               return -ENOMEM;
-
        disk->first_minor = 0;
        disk->flags = GENHD_FL_NO_PART_SCAN;
        disk->fops = &n64cart_fops;