diff options
-rw-r--r-- | drivers/scsi/BusLogic.c | 46 |
1 files changed, 37 insertions, 9 deletions
diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c index 16a12a3b7b2b..59d1adaed73e 100644 --- a/drivers/scsi/BusLogic.c +++ b/drivers/scsi/BusLogic.c | |||
@@ -2176,6 +2176,7 @@ static int __init BusLogic_init(void) | |||
2176 | { | 2176 | { |
2177 | int BusLogicHostAdapterCount = 0, DriverOptionsIndex = 0, ProbeIndex; | 2177 | int BusLogicHostAdapterCount = 0, DriverOptionsIndex = 0, ProbeIndex; |
2178 | struct BusLogic_HostAdapter *PrototypeHostAdapter; | 2178 | struct BusLogic_HostAdapter *PrototypeHostAdapter; |
2179 | int ret = 0; | ||
2179 | 2180 | ||
2180 | #ifdef MODULE | 2181 | #ifdef MODULE |
2181 | if (BusLogic) | 2182 | if (BusLogic) |
@@ -2282,25 +2283,49 @@ static int __init BusLogic_init(void) | |||
2282 | perform Target Device Inquiry. | 2283 | perform Target Device Inquiry. |
2283 | */ | 2284 | */ |
2284 | if (BusLogic_ReadHostAdapterConfiguration(HostAdapter) && | 2285 | if (BusLogic_ReadHostAdapterConfiguration(HostAdapter) && |
2285 | BusLogic_ReportHostAdapterConfiguration(HostAdapter) && BusLogic_AcquireResources(HostAdapter) && BusLogic_CreateInitialCCBs(HostAdapter) && BusLogic_InitializeHostAdapter(HostAdapter) && BusLogic_TargetDeviceInquiry(HostAdapter)) { | 2286 | BusLogic_ReportHostAdapterConfiguration(HostAdapter) && |
2287 | BusLogic_AcquireResources(HostAdapter) && | ||
2288 | BusLogic_CreateInitialCCBs(HostAdapter) && | ||
2289 | BusLogic_InitializeHostAdapter(HostAdapter) && | ||
2290 | BusLogic_TargetDeviceInquiry(HostAdapter)) { | ||
2286 | /* | 2291 | /* |
2287 | Initialization has been completed successfully. Release and | 2292 | Initialization has been completed successfully. Release and |
2288 | re-register usage of the I/O Address range so that the Model | 2293 | re-register usage of the I/O Address range so that the Model |
2289 | Name of the Host Adapter will appear, and initialize the SCSI | 2294 | Name of the Host Adapter will appear, and initialize the SCSI |
2290 | Host structure. | 2295 | Host structure. |
2291 | */ | 2296 | */ |
2292 | release_region(HostAdapter->IO_Address, HostAdapter->AddressCount); | 2297 | release_region(HostAdapter->IO_Address, |
2293 | if (!request_region(HostAdapter->IO_Address, HostAdapter->AddressCount, HostAdapter->FullModelName)) { | 2298 | HostAdapter->AddressCount); |
2294 | printk(KERN_WARNING "BusLogic: Release and re-register of " "port 0x%04lx failed \n", (unsigned long) HostAdapter->IO_Address); | 2299 | if (!request_region(HostAdapter->IO_Address, |
2300 | HostAdapter->AddressCount, | ||
2301 | HostAdapter->FullModelName)) { | ||
2302 | printk(KERN_WARNING | ||
2303 | "BusLogic: Release and re-register of " | ||
2304 | "port 0x%04lx failed \n", | ||
2305 | (unsigned long)HostAdapter->IO_Address); | ||
2295 | BusLogic_DestroyCCBs(HostAdapter); | 2306 | BusLogic_DestroyCCBs(HostAdapter); |
2296 | BusLogic_ReleaseResources(HostAdapter); | 2307 | BusLogic_ReleaseResources(HostAdapter); |
2297 | list_del(&HostAdapter->host_list); | 2308 | list_del(&HostAdapter->host_list); |
2298 | scsi_host_put(Host); | 2309 | scsi_host_put(Host); |
2310 | ret = -ENOMEM; | ||
2299 | } else { | 2311 | } else { |
2300 | BusLogic_InitializeHostStructure(HostAdapter, Host); | 2312 | BusLogic_InitializeHostStructure(HostAdapter, |
2301 | scsi_add_host(Host, HostAdapter->PCI_Device ? &HostAdapter->PCI_Device->dev : NULL); | 2313 | Host); |
2302 | scsi_scan_host(Host); | 2314 | if (scsi_add_host(Host, HostAdapter->PCI_Device |
2303 | BusLogicHostAdapterCount++; | 2315 | ? &HostAdapter->PCI_Device->dev |
2316 | : NULL)) { | ||
2317 | printk(KERN_WARNING | ||
2318 | "BusLogic: scsi_add_host()" | ||
2319 | "failed!\n"); | ||
2320 | BusLogic_DestroyCCBs(HostAdapter); | ||
2321 | BusLogic_ReleaseResources(HostAdapter); | ||
2322 | list_del(&HostAdapter->host_list); | ||
2323 | scsi_host_put(Host); | ||
2324 | ret = -ENODEV; | ||
2325 | } else { | ||
2326 | scsi_scan_host(Host); | ||
2327 | BusLogicHostAdapterCount++; | ||
2328 | } | ||
2304 | } | 2329 | } |
2305 | } else { | 2330 | } else { |
2306 | /* | 2331 | /* |
@@ -2315,12 +2340,13 @@ static int __init BusLogic_init(void) | |||
2315 | BusLogic_ReleaseResources(HostAdapter); | 2340 | BusLogic_ReleaseResources(HostAdapter); |
2316 | list_del(&HostAdapter->host_list); | 2341 | list_del(&HostAdapter->host_list); |
2317 | scsi_host_put(Host); | 2342 | scsi_host_put(Host); |
2343 | ret = -ENODEV; | ||
2318 | } | 2344 | } |
2319 | } | 2345 | } |
2320 | kfree(PrototypeHostAdapter); | 2346 | kfree(PrototypeHostAdapter); |
2321 | kfree(BusLogic_ProbeInfoList); | 2347 | kfree(BusLogic_ProbeInfoList); |
2322 | BusLogic_ProbeInfoList = NULL; | 2348 | BusLogic_ProbeInfoList = NULL; |
2323 | return 0; | 2349 | return ret; |
2324 | } | 2350 | } |
2325 | 2351 | ||
2326 | 2352 | ||
@@ -2954,6 +2980,7 @@ static int BusLogic_QueueCommand(struct scsi_cmnd *Command, void (*CompletionRou | |||
2954 | } | 2980 | } |
2955 | 2981 | ||
2956 | 2982 | ||
2983 | #if 0 | ||
2957 | /* | 2984 | /* |
2958 | BusLogic_AbortCommand aborts Command if possible. | 2985 | BusLogic_AbortCommand aborts Command if possible. |
2959 | */ | 2986 | */ |
@@ -3024,6 +3051,7 @@ static int BusLogic_AbortCommand(struct scsi_cmnd *Command) | |||
3024 | return SUCCESS; | 3051 | return SUCCESS; |
3025 | } | 3052 | } |
3026 | 3053 | ||
3054 | #endif | ||
3027 | /* | 3055 | /* |
3028 | BusLogic_ResetHostAdapter resets Host Adapter if possible, marking all | 3056 | BusLogic_ResetHostAdapter resets Host Adapter if possible, marking all |
3029 | currently executing SCSI Commands as having been Reset. | 3057 | currently executing SCSI Commands as having been Reset. |