--- ./dpt_i2o.c.d2o2 2006-08-16 06:21:25.000000000 +0400 +++ ./dpt_i2o.c 2006-08-16 06:22:16.000000000 +0400 @@ -4532,17 +4532,17 @@ static int __init dpt_init(void) #endif error = pci_register_driver(&dpt_pci_driver); -#if ((LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) && defined(SCSI_HAS_SCSI_IN_DETECTION)) + if (error < 0 || hba_count == 0) { + pci_unregister_driver(&dpt_pci_driver); +#if ((LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) && defined(SCSI_HAS_SCSI_IN_DETECTION)) scsi_unregister_module(MODULE_SCSI_HA,&driver_template); +#endif +#ifdef REBOOT_NOTIFIER + unregister_reboot_notifier(&adpt_reboot_notifier); +#endif return (error < 0) ? error : -ENODEV; } -#else - if (error < 0) - return error; - if (hba_count == 0) - return -ENODEV; -#endif /* In INIT state, Activate IOPs */ for (pHba = hba_chain; pHba; pHba = pHba->next) { // Activate does get status , init outbound, and get hrt