]> git.hungrycats.org Git - linux/commitdiff
request_region janitor updates for BusLogic SCSI driver.
authorWilliam Stinson <wstinson@infonie.fr>
Tue, 30 Apr 2002 22:27:35 +0000 (18:27 -0400)
committerJeff Garzik <jgarzik@mandrakesoft.com>
Tue, 30 Apr 2002 22:27:35 +0000 (18:27 -0400)
drivers/scsi/BusLogic.c

index c6ceeda9c11b9f1d8301646db51589bd43af7b19..e7e9dcab1884fc501c33b5c70b3d04311c6c4a15 100644 (file)
@@ -2792,8 +2792,8 @@ int BusLogic_DetectHostAdapter(SCSI_Host_Template_T *HostTemplate)
        released, thereby preventing it from being incorrectly identified as
        any other type of Host Adapter.
       */
-      request_region(HostAdapter->IO_Address, HostAdapter->AddressCount,
-                    "BusLogic");
+      if (!request_region(HostAdapter->IO_Address, HostAdapter->AddressCount,
+                    "BusLogic")) continue;
       /*
        Register the SCSI Host structure.
       */
@@ -2834,11 +2834,20 @@ int BusLogic_DetectHostAdapter(SCSI_Host_Template_T *HostTemplate)
          */
          release_region(HostAdapter->IO_Address,
                         HostAdapter->AddressCount);
-         request_region(HostAdapter->IO_Address,
-                        HostAdapter->AddressCount,
-                        HostAdapter->FullModelName);
-         BusLogic_InitializeHostStructure(HostAdapter, Host);
-         BusLogicHostAdapterCount++;
+         if(!request_region(HostAdapter->IO_Address,
+                            HostAdapter->AddressCount,
+                            HostAdapter->FullModelName)) {
+                 printk(KERN_WARNING "BusLogic: Release and re-register of "
+                        "port 0x%04lx failed \n", HostAdapter->IO_Address);
+                 BusLogic_DestroyCCBs(HostAdapter);
+                 BusLogic_ReleaseResources(HostAdapter);
+                 BusLogic_UnregisterHostAdapter(HostAdapter);
+                 scsi_unregister(Host);
+         }
+         else {
+                 BusLogic_InitializeHostStructure(HostAdapter, Host);
+                 BusLogicHostAdapterCount++;
+         }
        }
       else
        {