summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid
diff options
context:
space:
mode:
authorRaghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>2017-05-10 09:39:47 -0700
committerMartin K. Petersen <martin.petersen@oracle.com>2017-06-12 20:48:00 -0400
commit5aa60732520dd0476ed9e20047b837780bbb7799 (patch)
tree0a54fa17e584ff4c2a4dd0a282889f4874079826 /drivers/scsi/aacraid
parent77cb6d5ea6033e5d477947aa682728959d6c3f8f (diff)
downloadlinux-5aa60732520dd0476ed9e20047b837780bbb7799.tar.gz
linux-5aa60732520dd0476ed9e20047b837780bbb7799.tar.bz2
linux-5aa60732520dd0476ed9e20047b837780bbb7799.zip
scsi: aacraid: Rework aac_src_restart
Removed switch case and replaced with if mask checks. Moved KERNEL_PANIC check to when bled is less than 0. Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> Reviewed-by: David Carroll <david.carroll@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/aacraid')
-rw-r--r--drivers/scsi/aacraid/src.c34
1 files changed, 12 insertions, 22 deletions
diff --git a/drivers/scsi/aacraid/src.c b/drivers/scsi/aacraid/src.c
index 9ad60d63586d..e7b4c0782806 100644
--- a/drivers/scsi/aacraid/src.c
+++ b/drivers/scsi/aacraid/src.c
@@ -772,8 +772,7 @@ static int aac_src_restart_adapter(struct aac_dev *dev, int bled, u8 reset_type)
dev->a_ops.adapter_enable_int = aac_src_disable_interrupt;
- switch (reset_type) {
- case IOP_HWSOFT_RESET:
+ if (reset_type & HW_IOP_RESET) {
aac_send_iop_reset(dev);
/*
@@ -784,12 +783,14 @@ static int aac_src_restart_adapter(struct aac_dev *dev, int bled, u8 reset_type)
dev_err(&dev->pdev->dev, "IOP reset failed\n");
else
goto set_startup;
+ }
- if (!dev->sa_firmware) {
- ret = -ENODEV;
- goto out;
- }
+ if (!dev->sa_firmware) {
+ ret = -ENODEV;
+ goto out;
+ }
+ if (reset_type & HW_SOFT_RESET) {
aac_send_hardware_soft_reset(dev);
dev->msi_enabled = 0;
@@ -799,30 +800,19 @@ static int aac_src_restart_adapter(struct aac_dev *dev, int bled, u8 reset_type)
ret = -ENODEV;
goto out;
}
-
- break;
- case HW_SOFT_RESET:
- if (dev->sa_firmware) {
- aac_send_hardware_soft_reset(dev);
- aac_set_intx_mode(dev);
- }
- break;
- default:
- aac_send_iop_reset(dev);
- break;
}
-invalid_out:
-
- if (src_readl(dev, MUnit.OMR) & KERNEL_PANIC)
- ret = -ENODEV;
-
set_startup:
if (startup_timeout < 300)
startup_timeout = 300;
out:
return ret;
+
+invalid_out:
+ if (src_readl(dev, MUnit.OMR) & KERNEL_PANIC)
+ ret = -ENODEV;
+goto out;
}
/**