Commit a339cf2b authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe
Browse files

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: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20240215070300.2200308-11-hch@lst.de


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent d0fa9a8b
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -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;