diff options
author | Christoph Hellwig <hch@lst.de> | 2024-02-15 08:02:53 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-02-19 16:59:31 -0700 |
commit | a339cf2bbfbe6e16ead79276d608912d36065884 (patch) | |
tree | fdb837c01ba604c10f1c9210b70912e03bc86c59 | |
parent | d0fa9a8b0af71b69cf3dec10feaebe19d55a72cf (diff) | |
download | linux-stable-a339cf2bbfbe6e16ead79276d608912d36065884.tar.gz linux-stable-a339cf2bbfbe6e16ead79276d608912d36065884.tar.bz2 linux-stable-a339cf2bbfbe6e16ead79276d608912d36065884.zip |
gdrom: pass queue_limits to blk_mq_alloc_disk
Pass the few limits gdrom imposes directly to blk_mq_alloc_disk instead
of setting them one at a time.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20240215070300.2200308-11-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | drivers/cdrom/gdrom.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/cdrom/gdrom.c b/drivers/cdrom/gdrom.c index 1d044779f5e4..9398beeb5d1e 100644 --- a/drivers/cdrom/gdrom.c +++ b/drivers/cdrom/gdrom.c @@ -724,11 +724,6 @@ static void probe_gdrom_setupdisk(void) static int probe_gdrom_setupqueue(void) { - blk_queue_logical_block_size(gd.gdrom_rq, GDROM_HARD_SECTOR); - /* using DMA so memory will need to be contiguous */ - blk_queue_max_segments(gd.gdrom_rq, 1); - /* set a large max size to get most from DMA */ - blk_queue_max_segment_size(gd.gdrom_rq, 0x40000); gd.disk->queue = gd.gdrom_rq; return gdrom_init_dma_mode(); } @@ -743,6 +738,13 @@ static const struct blk_mq_ops gdrom_mq_ops = { */ static int probe_gdrom(struct platform_device *devptr) { + struct queue_limits lim = { + .logical_block_size = GDROM_HARD_SECTOR, + /* using DMA so memory will need to be contiguous */ + .max_segments = 1, + /* set a large max size to get most from DMA */ + .max_segment_size = 0x40000, + }; int err; /* @@ -778,7 +780,7 @@ static int probe_gdrom(struct platform_device *devptr) if (err) goto probe_fail_free_cd_info; - gd.disk = blk_mq_alloc_disk(&gd.tag_set, NULL, NULL); + gd.disk = blk_mq_alloc_disk(&gd.tag_set, &lim, NULL); if (IS_ERR(gd.disk)) { err = PTR_ERR(gd.disk); goto probe_fail_free_tag_set; |