Skip to content

Commit 4d195dc

Browse files
Can Guomartinkpetersen
authored andcommitted
scsi: ufs: Remove redundant checks of !hba in suspend/resume callbacks
Runtime and system suspend/resume can only come after hba probe invokes platform_set_drvdata(pdev, hba), meaning hba cannot be NULL in these PM callbacks, so remove the checks of !hba. Link: https://lore.kernel.org/r/1614145010-36079-4-git-send-email-cang@codeaurora.org Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Can Guo <cang@codeaurora.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 4a79157 commit 4d195dc

1 file changed

Lines changed: 0 additions & 21 deletions

File tree

drivers/scsi/ufs/ufshcd.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@
9595
16, 4, buf, __len, false); \
9696
} while (0)
9797

98-
static bool early_suspend;
99-
10098
int ufshcd_dump_regs(struct ufs_hba *hba, size_t offset, size_t len,
10199
const char *prefix)
102100
{
@@ -8978,11 +8976,6 @@ int ufshcd_system_suspend(struct ufs_hba *hba)
89788976
int ret = 0;
89798977
ktime_t start = ktime_get();
89808978

8981-
if (!hba) {
8982-
early_suspend = true;
8983-
return 0;
8984-
}
8985-
89868979
down(&hba->host_sem);
89878980

89888981
if (!hba->is_powered)
@@ -9034,14 +9027,6 @@ int ufshcd_system_resume(struct ufs_hba *hba)
90349027
int ret = 0;
90359028
ktime_t start = ktime_get();
90369029

9037-
if (!hba)
9038-
return -EINVAL;
9039-
9040-
if (unlikely(early_suspend)) {
9041-
early_suspend = false;
9042-
down(&hba->host_sem);
9043-
}
9044-
90459030
if (!hba->is_powered || pm_runtime_suspended(hba->dev))
90469031
/*
90479032
* Let the runtime resume take care of resuming
@@ -9074,9 +9059,6 @@ int ufshcd_runtime_suspend(struct ufs_hba *hba)
90749059
int ret = 0;
90759060
ktime_t start = ktime_get();
90769061

9077-
if (!hba)
9078-
return -EINVAL;
9079-
90809062
if (!hba->is_powered)
90819063
goto out;
90829064
else
@@ -9115,9 +9097,6 @@ int ufshcd_runtime_resume(struct ufs_hba *hba)
91159097
int ret = 0;
91169098
ktime_t start = ktime_get();
91179099

9118-
if (!hba)
9119-
return -EINVAL;
9120-
91219100
if (!hba->is_powered)
91229101
goto out;
91239102
else

0 commit comments

Comments
 (0)