mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
UPSTREAM: scsi: ufs: Simplify ufshcd_set_dev_pwr_mode()
Simplify the code for incrementing the SCSI device reference count in
ufshcd_set_dev_pwr_mode(). This commit removes one scsi_device_put() call
that happens from atomic context.
Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Avri Altman <avri.altman@wdc.com>
Change-Id: Ic9119eef18944685fe388919d89ea0ce486850a5
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20221015002418.30955-7-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 258234315
(cherry picked from commit 6d1aa3b058)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
This commit is contained in:
committed by
Alistair Delva
parent
a03f31d081
commit
422472d6ac
@@ -8832,15 +8832,10 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba,
|
||||
|
||||
spin_lock_irqsave(hba->host->host_lock, flags);
|
||||
sdp = hba->ufs_device_wlun;
|
||||
if (sdp) {
|
||||
if (sdp && scsi_device_online(sdp))
|
||||
ret = scsi_device_get(sdp);
|
||||
if (!ret && !scsi_device_online(sdp)) {
|
||||
ret = -ENODEV;
|
||||
scsi_device_put(sdp);
|
||||
}
|
||||
} else {
|
||||
else
|
||||
ret = -ENODEV;
|
||||
}
|
||||
spin_unlock_irqrestore(hba->host->host_lock, flags);
|
||||
|
||||
if (ret)
|
||||
|
||||
Reference in New Issue
Block a user