Commit 1d1fec53 authored by Raghava Aditya Renukunta's avatar Raghava Aditya Renukunta Committed by Martin K. Petersen

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: default avatarRaghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 0bcb45fb
...@@ -2021,6 +2021,10 @@ static int aac_setup_safw_targets(struct aac_dev *dev, int rescan) ...@@ -2021,6 +2021,10 @@ static int aac_setup_safw_targets(struct aac_dev *dev, int rescan)
{ {
int rcode = 0; int rcode = 0;
rcode = aac_get_containers(dev);
if (unlikely(rcode < 0))
goto out;
rcode = aac_get_safw_ciss_luns(dev, rescan); rcode = aac_get_safw_ciss_luns(dev, rescan);
if (unlikely(rcode < 0)) if (unlikely(rcode < 0))
goto out; goto out;
......
...@@ -1949,26 +1949,22 @@ static void aac_handle_sa_aif(struct aac_dev *dev, struct fib *fibptr) ...@@ -1949,26 +1949,22 @@ static void aac_handle_sa_aif(struct aac_dev *dev, struct fib *fibptr)
aac_resolve_luns(dev); aac_resolve_luns(dev);
if (events == SA_AIF_LDEV_CHANGE || for (container = 0; container <
events == SA_AIF_BPCFG_CHANGE) {
aac_get_containers(dev);
for (container = 0; container <
dev->maximum_num_containers; ++container) { dev->maximum_num_containers; ++container) {
sdev = scsi_device_lookup(dev->scsi_host_ptr, sdev = scsi_device_lookup(dev->scsi_host_ptr,
CONTAINER_CHANNEL, CONTAINER_CHANNEL,
container, 0); container, 0);
if (dev->fsa_dev[container].valid && !sdev) { if (dev->fsa_dev[container].valid && !sdev) {
scsi_add_device(dev->scsi_host_ptr, scsi_add_device(dev->scsi_host_ptr,
CONTAINER_CHANNEL, CONTAINER_CHANNEL,
container, 0); container, 0);
} else if (!dev->fsa_dev[container].valid && } else if (!dev->fsa_dev[container].valid &&
sdev) { sdev) {
scsi_remove_device(sdev); scsi_remove_device(sdev);
scsi_device_put(sdev); scsi_device_put(sdev);
} else if (sdev) { } else if (sdev) {
scsi_rescan_device(&sdev->sdev_gendev); scsi_rescan_device(&sdev->sdev_gendev);
scsi_device_put(sdev); scsi_device_put(sdev);
}
} }
} }
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment