Skip to content

Commit d34ee53

Browse files
Yihang Limartinkpetersen
authored andcommitted
scsi: hisi_sas: Replace with standard error code return value
In function hisi_sas_controller_prereset(), -ENOSYS (Function not implemented) should be returned if the driver does not support .soft_reset. Returns -EPERM (Operation not permitted) if HISI_SAS_RESETTING_BIT is already be set. In function _suspend_v3_hw(), returns -EPERM (Operation not permitted) if HISI_SAS_RESETTING_BIT is already be set. Fixes: 4522204 ("scsi: hisi_sas: tidy host controller reset function a bit") Signed-off-by: Yihang Li <[email protected]> Signed-off-by: Xiang Chen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent ce26497 commit d34ee53

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

drivers/scsi/hisi_sas/hisi_sas_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,12 +1565,12 @@ EXPORT_SYMBOL_GPL(hisi_sas_controller_reset_done);
15651565
static int hisi_sas_controller_prereset(struct hisi_hba *hisi_hba)
15661566
{
15671567
if (!hisi_hba->hw->soft_reset)
1568-
return -1;
1568+
return -ENOENT;
15691569

15701570
down(&hisi_hba->sem);
15711571
if (test_and_set_bit(HISI_SAS_RESETTING_BIT, &hisi_hba->flags)) {
15721572
up(&hisi_hba->sem);
1573-
return -1;
1573+
return -EPERM;
15741574
}
15751575

15761576
if (hisi_sas_debugfs_enable && hisi_hba->debugfs_itct[0].itct)

drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5018,7 +5018,7 @@ static int _suspend_v3_hw(struct device *device)
50185018
}
50195019

50205020
if (test_and_set_bit(HISI_SAS_RESETTING_BIT, &hisi_hba->flags))
5021-
return -1;
5021+
return -EPERM;
50225022

50235023
dev_warn(dev, "entering suspend state\n");
50245024

0 commit comments

Comments
 (0)