[SCSI] gdth: fix Error: Driver 'gdth' is already registered, aborting...

This message appears on modprobe/rmmod/modprobe of the driver. It's
caused because if the driver has no instances, it returns an error
from gdth_init, which causes the module to fail to load.
Unfortunately, the module's pci driver is still registered at this
point.

Fix this by making gdth behave like a modern driver and insert even if
it doesn't find any instances (in case of hot plug or software driven
binding).

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>

+8 -5
+8 -5
drivers/scsi/gdth.c
··· 550 550 #endif /* CONFIG_ISA */ 551 551 552 552 #ifdef CONFIG_PCI 553 - static bool gdth_pci_registered; 554 553 555 554 static bool gdth_search_vortex(ushort device) 556 555 { ··· 5156 5157 5157 5158 #ifdef CONFIG_PCI 5158 5159 /* scanning for PCI controllers */ 5159 - if (pci_register_driver(&gdth_pci_driver) == 0) 5160 - gdth_pci_registered = true; 5160 + if (pci_register_driver(&gdth_pci_driver)) { 5161 + gdth_ha_str *ha; 5162 + 5163 + list_for_each_entry(ha, &gdth_instances, list) 5164 + gdth_remove_one(ha); 5165 + return -ENODEV; 5166 + } 5161 5167 #endif /* CONFIG_PCI */ 5162 5168 5163 5169 TRACE2(("gdth_detect() %d controller detected\n", gdth_ctr_count)); ··· 5185 5181 #endif 5186 5182 5187 5183 #ifdef CONFIG_PCI 5188 - if (gdth_pci_registered) 5189 - pci_unregister_driver(&gdth_pci_driver); 5184 + pci_unregister_driver(&gdth_pci_driver); 5190 5185 #endif 5191 5186 5192 5187 list_for_each_entry(ha, &gdth_instances, list)