scsi: sbp2: Switch to using ->device_configure
authorChristoph Hellwig <hch@lst.de>
Tue, 9 Apr 2024 14:37:38 +0000 (16:37 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 12 Apr 2024 01:37:49 +0000 (21:37 -0400)
Switch to the ->device_configure method instead of ->slave_configure and
update the block limits on the passed in queue_limits instead of using the
per-limit accessors.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20240409143748.980206-14-hch@lst.de
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/firewire/sbp2.c

index 8f7810b2a4c10f894657fbe9e26caf44e274d203..827dee0f57dde2324f2de93c92284e8eca990812 100644 (file)
@@ -1506,7 +1506,8 @@ static int sbp2_scsi_slave_alloc(struct scsi_device *sdev)
        return 0;
 }
 
-static int sbp2_scsi_slave_configure(struct scsi_device *sdev)
+static int sbp2_scsi_device_configure(struct scsi_device *sdev,
+               struct queue_limits *lim)
 {
        struct sbp2_logical_unit *lu = sdev->hostdata;
 
@@ -1532,7 +1533,7 @@ static int sbp2_scsi_slave_configure(struct scsi_device *sdev)
                sdev->start_stop_pwr_cond = 1;
 
        if (lu->tgt->workarounds & SBP2_WORKAROUND_128K_MAX_TRANS)
-               blk_queue_max_hw_sectors(sdev->request_queue, 128 * 1024 / 512);
+               lim->max_hw_sectors = 128 * 1024 / 512;
 
        return 0;
 }
@@ -1590,7 +1591,7 @@ static const struct scsi_host_template scsi_driver_template = {
        .proc_name              = "sbp2",
        .queuecommand           = sbp2_scsi_queuecommand,
        .slave_alloc            = sbp2_scsi_slave_alloc,
-       .slave_configure        = sbp2_scsi_slave_configure,
+       .device_configure       = sbp2_scsi_device_configure,
        .eh_abort_handler       = sbp2_scsi_abort,
        .this_id                = -1,
        .sg_tablesize           = SG_ALL,