Skip to content

Commit 31e6e7e

Browse files
bvanasschemartinkpetersen
authored andcommitted
scsi: ufs: core: Use scsi_device_busy()
Use scsi_device_busy() instead of open-coding it. This patch prepares for skipping the SCSI device budget map initialization in certain cases. Reviewed-by: Peter Wang <peter.wang@mediatek.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://patch.msgid.link/20251113235252.2015185-1-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 02b5822 commit 31e6e7e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/ufs/core/ufshcd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,13 +1290,13 @@ static bool ufshcd_is_devfreq_scaling_required(struct ufs_hba *hba,
12901290
*/
12911291
static u32 ufshcd_pending_cmds(struct ufs_hba *hba)
12921292
{
1293-
const struct scsi_device *sdev;
1293+
struct scsi_device *sdev;
12941294
unsigned long flags;
12951295
u32 pending = 0;
12961296

12971297
spin_lock_irqsave(hba->host->host_lock, flags);
12981298
__shost_for_each_device(sdev, hba->host)
1299-
pending += sbitmap_weight(&sdev->budget_map);
1299+
pending += scsi_device_busy(sdev);
13001300
spin_unlock_irqrestore(hba->host->host_lock, flags);
13011301

13021302
return pending;

0 commit comments

Comments
 (0)