From: Christoph Hellwig Date: Thu, 15 Feb 2024 07:02:46 +0000 (+0100) Subject: floppy: pass queue_limits to blk_mq_alloc_disk X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=48bc8c7ba6fb39a4325b07f3abe8fe5a77361c7e;p=people%2Faperard%2Flinux.git floppy: pass queue_limits to blk_mq_alloc_disk Pass the few limits floppy imposes directly to blk_mq_alloc_disk instead of setting them one at a time. Signed-off-by: Christoph Hellwig Reviewed-by: Denis Efremov Link: https://lore.kernel.org/r/20240215070300.2200308-4-hch@lst.de Signed-off-by: Jens Axboe --- diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 582cf50c6bf6b..1b399ec8c07d1 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -4516,13 +4516,15 @@ static bool floppy_available(int drive) static int floppy_alloc_disk(unsigned int drive, unsigned int type) { + struct queue_limits lim = { + .max_hw_sectors = 64, + }; struct gendisk *disk; - disk = blk_mq_alloc_disk(&tag_sets[drive], NULL, NULL); + disk = blk_mq_alloc_disk(&tag_sets[drive], &lim, NULL); if (IS_ERR(disk)) return PTR_ERR(disk); - blk_queue_max_hw_sectors(disk->queue, 64); disk->major = FLOPPY_MAJOR; disk->first_minor = TOMINOR(drive) | (type << 2); disk->minors = 1;