Skip to content

Commit 84a44a8

Browse files
Christoph Hellwigmartinkpetersen
authored andcommitted
scsi: uas: Switch to using ->device_configure to configure queue limits
Switch to the ->device_configure method instead of ->slave_alloc and update the block limits on the passed in queue_limits instead of using the per-limit accessors. Note that uas was the only driver setting these size limits from ->slave_alloc and not ->slave_configure and this makes it match everyone else. Signed-off-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Damien Le Moal <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 30efd38 commit 84a44a8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

drivers/usb/storage/uas.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -823,19 +823,19 @@ static int uas_slave_alloc(struct scsi_device *sdev)
823823
(struct uas_dev_info *)sdev->host->hostdata;
824824

825825
sdev->hostdata = devinfo;
826-
827-
if (devinfo->flags & US_FL_MAX_SECTORS_64)
828-
blk_queue_max_hw_sectors(sdev->request_queue, 64);
829-
else if (devinfo->flags & US_FL_MAX_SECTORS_240)
830-
blk_queue_max_hw_sectors(sdev->request_queue, 240);
831-
832826
return 0;
833827
}
834828

835-
static int uas_slave_configure(struct scsi_device *sdev)
829+
static int uas_device_configure(struct scsi_device *sdev,
830+
struct queue_limits *lim)
836831
{
837832
struct uas_dev_info *devinfo = sdev->hostdata;
838833

834+
if (devinfo->flags & US_FL_MAX_SECTORS_64)
835+
lim->max_hw_sectors = 64;
836+
else if (devinfo->flags & US_FL_MAX_SECTORS_240)
837+
lim->max_hw_sectors = 240;
838+
839839
if (devinfo->flags & US_FL_NO_REPORT_OPCODES)
840840
sdev->no_report_opcodes = 1;
841841

@@ -900,7 +900,7 @@ static const struct scsi_host_template uas_host_template = {
900900
.queuecommand = uas_queuecommand,
901901
.target_alloc = uas_target_alloc,
902902
.slave_alloc = uas_slave_alloc,
903-
.slave_configure = uas_slave_configure,
903+
.device_configure = uas_device_configure,
904904
.eh_abort_handler = uas_eh_abort_handler,
905905
.eh_device_reset_handler = uas_eh_device_reset_handler,
906906
.this_id = -1,

0 commit comments

Comments
 (0)