diff options
author | Bart Van Assche <bvanassche@acm.org> | 2021-12-03 15:19:41 -0800 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-12-06 22:30:33 -0500 |
commit | fc21da8a840a93fd3512e5d779cbb0996cc1b4f1 (patch) | |
tree | 2936366a6c1e637693055ab261a7272a5e13a482 /drivers/scsi/ufs | |
parent | bd0b35383193d0d31a0cce3d7c7f7e4be1cc7905 (diff) | |
download | linux-fc21da8a840a93fd3512e5d779cbb0996cc1b4f1.tar.bz2 |
scsi: ufs: Rework ufshcd_change_queue_depth()
Prepare for making sdev->host->can_queue less than hba->nutrs. This patch
does not change any functionality.
Link: https://lore.kernel.org/r/20211203231950.193369-9-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/ufs')
-rw-r--r-- | drivers/scsi/ufs/ufshcd.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 974bf47e733c..2d0f59424b00 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -4936,11 +4936,7 @@ static int ufshcd_slave_alloc(struct scsi_device *sdev) */ static int ufshcd_change_queue_depth(struct scsi_device *sdev, int depth) { - struct ufs_hba *hba = shost_priv(sdev->host); - - if (depth > hba->nutrs) - depth = hba->nutrs; - return scsi_change_queue_depth(sdev, depth); + return scsi_change_queue_depth(sdev, min(depth, sdev->host->can_queue)); } static void ufshcd_hpb_destroy(struct ufs_hba *hba, struct scsi_device *sdev) |