Commit f83fc7fe authored by Christoph Hellwig's avatar Christoph Hellwig

[PATCH] fix aic79xx module_init return value when no hardware

So much rearranging to just propagate the pci_module_init return value..
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent edec4582
...@@ -851,6 +851,7 @@ ahd_linux_detect(Scsi_Host_Template *template) ...@@ -851,6 +851,7 @@ ahd_linux_detect(Scsi_Host_Template *template)
{ {
struct ahd_softc *ahd; struct ahd_softc *ahd;
int found; int found;
int error = 0;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
/* /*
...@@ -902,7 +903,9 @@ ahd_linux_detect(Scsi_Host_Template *template) ...@@ -902,7 +903,9 @@ ahd_linux_detect(Scsi_Host_Template *template)
ahd_list_lockinit(); ahd_list_lockinit();
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
ahd_linux_pci_init(); error = ahd_linux_pci_init();
if (error)
return error;
#endif #endif
/* /*
...@@ -919,7 +922,7 @@ ahd_linux_detect(Scsi_Host_Template *template) ...@@ -919,7 +922,7 @@ ahd_linux_detect(Scsi_Host_Template *template)
spin_lock_irq(&io_request_lock); spin_lock_irq(&io_request_lock);
#endif #endif
aic79xx_detect_complete++; aic79xx_detect_complete++;
return (found); return 0;
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
...@@ -5079,7 +5082,7 @@ static int __init ...@@ -5079,7 +5082,7 @@ static int __init
ahd_linux_init(void) ahd_linux_init(void)
{ {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
return (ahd_linux_detect(&aic79xx_driver_template) ? 0 : -ENODEV); return ahd_linux_detect(&aic79xx_driver_template);
#else #else
scsi_register_module(MODULE_SCSI_HA, &aic79xx_driver_template); scsi_register_module(MODULE_SCSI_HA, &aic79xx_driver_template);
if (aic79xx_driver_template.present == 0) { if (aic79xx_driver_template.present == 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment