Commit b44c1d52 authored by James Bottomley's avatar James Bottomley Committed by James Bottomley

[PATCH] fix aic7xxx probing

aic7xxx probing routines are still wrong on eisa.

Fix eisa by incrementing found if it returns successfully
Also make all the various incarnations of the pci probing routine
consistently return the number of found cards (or 1 for the later
generic device model probing).
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 530fa7dc
......@@ -844,7 +844,6 @@ ahc_linux_detect(Scsi_Host_Template *template)
{
struct ahc_softc *ahc;
int found = 0;
int eisa_err, pci_err;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
/*
......@@ -892,13 +891,10 @@ ahc_linux_detect(Scsi_Host_Template *template)
*/
ahc_list_lockinit();
pci_err = ahc_linux_pci_init();
eisa_err = ahc_linux_eisa_init();
if(pci_err && eisa_err)
goto out;
found = ahc_linux_pci_init();
if (!ahc_linux_eisa_init())
found++;
/*
* Register with the SCSI layer all
* controllers we've found.
......@@ -908,7 +904,6 @@ ahc_linux_detect(Scsi_Host_Template *template)
if (ahc_linux_register_host(ahc, template) == 0)
found++;
}
out:
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
spin_lock_irq(&io_request_lock);
......
......@@ -940,7 +940,7 @@ ahc_get_pci_bus(ahc_dev_softc_t pci)
}
#else
static inline int ahc_linux_pci_init(void) {
return -ENODEV;
return 0;
}
static inline void ahc_linux_pci_exit(void) {
}
......
......@@ -198,7 +198,8 @@ int
ahc_linux_pci_init(void)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
return (pci_module_init(&aic7xxx_pci_driver));
/* Translate error or zero return into zero or one */
return pci_module_init(&aic7xxx_pci_driver) ? 0 : 1;
#else
struct pci_dev *pdev;
u_int class;
......
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