summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRaghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>2017-12-26 20:34:39 -0800
committerMartin K. Petersen <martin.petersen@oracle.com>2018-01-03 23:26:42 -0500
commit1d1fec53dc13d56c80b02d391c7d593d9a502d6d (patch)
treec876a41ef135d819fe03e316d8a3144fee9e31ef /drivers
parent0bcb45fb20c2195fe0ae175d4775241e672a5fd3 (diff)
downloadtalos-obmc-linux-1d1fec53dc13d56c80b02d391c7d593d9a502d6d.tar.gz
talos-obmc-linux-1d1fec53dc13d56c80b02d391c7d593d9a502d6d.zip
scsi: aacraid: Merge func to get container information
Merge aac_get_containers to setup target function, so that information about all the present devices can be retrieved in one shot. Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/aacraid/aachba.c4
-rw-r--r--drivers/scsi/aacraid/commsup.c34
2 files changed, 19 insertions, 19 deletions
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 67ca5af32e02..c30f7da1937f 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -2021,6 +2021,10 @@ static int aac_setup_safw_targets(struct aac_dev *dev, int rescan)
{
int rcode = 0;
+ rcode = aac_get_containers(dev);
+ if (unlikely(rcode < 0))
+ goto out;
+
rcode = aac_get_safw_ciss_luns(dev, rescan);
if (unlikely(rcode < 0))
goto out;
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index f3077b37bea1..9625eb0d7a51 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -1949,26 +1949,22 @@ static void aac_handle_sa_aif(struct aac_dev *dev, struct fib *fibptr)
aac_resolve_luns(dev);
- if (events == SA_AIF_LDEV_CHANGE ||
- events == SA_AIF_BPCFG_CHANGE) {
- aac_get_containers(dev);
- for (container = 0; container <
+ for (container = 0; container <
dev->maximum_num_containers; ++container) {
- sdev = scsi_device_lookup(dev->scsi_host_ptr,
- CONTAINER_CHANNEL,
- container, 0);
- if (dev->fsa_dev[container].valid && !sdev) {
- scsi_add_device(dev->scsi_host_ptr,
- CONTAINER_CHANNEL,
- container, 0);
- } else if (!dev->fsa_dev[container].valid &&
- sdev) {
- scsi_remove_device(sdev);
- scsi_device_put(sdev);
- } else if (sdev) {
- scsi_rescan_device(&sdev->sdev_gendev);
- scsi_device_put(sdev);
- }
+ sdev = scsi_device_lookup(dev->scsi_host_ptr,
+ CONTAINER_CHANNEL,
+ container, 0);
+ if (dev->fsa_dev[container].valid && !sdev) {
+ scsi_add_device(dev->scsi_host_ptr,
+ CONTAINER_CHANNEL,
+ container, 0);
+ } else if (!dev->fsa_dev[container].valid &&
+ sdev) {
+ scsi_remove_device(sdev);
+ scsi_device_put(sdev);
+ } else if (sdev) {
+ scsi_rescan_device(&sdev->sdev_gendev);
+ scsi_device_put(sdev);
}
}
break;
OpenPOWER on IntegriCloud