]> git.baikalelectronics.ru Git - kernel.git/commitdiff
scsi: aacraid: Merge func to get container information
authorRaghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Wed, 27 Dec 2017 04:34:39 +0000 (20:34 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 4 Jan 2018 04:26:42 +0000 (23:26 -0500)
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>
drivers/scsi/aacraid/aachba.c
drivers/scsi/aacraid/commsup.c

index 67ca5af32e02415ae46bca46d242ccff766113ac..c30f7da1937f901a63d45cf97e514a10428303c9 100644 (file)
@@ -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;
index f3077b37bea1a89fe1c84343097410a101017334..9625eb0d7a51e13bd51875ac6d0c1439431c10c6 100644 (file)
@@ -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;