* prepare for this device to go away
*-F*************************************************************************/
static void
-aic7xxx_slave_destroy(Scsi_Device *sdpnt)
+aic7xxx_slave_destroy(Scsi_Device *SDptr)
{
- struct aic_dev_data *aic_dev = sdpnt->hostdata;
+ struct aic_dev_data *aic_dev = SDptr->hostdata;
list_del(&aic_dev->list);
- sdpnt->hostdata = NULL;
+ SDptr->hostdata = NULL;
kfree(aic_dev);
return;
}
* depths, allocate command structs, etc.
*-F*************************************************************************/
static int
-aic7xxx_slave_configure(Scsi_Device *sdpnt)
+aic7xxx_slave_configure(Scsi_Device *SDptr)
{
- struct aic7xxx_host *p = (struct aic7xxx_host *) sdpnt->host->hostdata;
+ struct aic7xxx_host *p = (struct aic7xxx_host *) SDptr->host->hostdata;
struct aic_dev_data *aic_dev;
int scbnum;
- aic_dev = (struct aic_dev_data *)sdpnt->hostdata;
+ aic_dev = (struct aic_dev_data *)SDptr->hostdata;
aic7xxx_init_transinfo(p, aic_dev);
- aic7xxx_device_queue_depth(p, sdpnt);
+ aic7xxx_device_queue_depth(p, SDptr);
if(list_empty(&aic_dev->list))
list_add_tail(&aic_dev->list, &p->aic_devs);
template->proc_name = "aic7xxx";
template->sg_tablesize = AIC7XXX_MAX_SG;
- template->max_sectors = 2048;
#ifdef CONFIG_PCI
{
/* duplicate PCI entry, skip it */
kfree(temp_p);
- temp_p = NULL;
+ continue;
}
current_p = current_p->next;
}
- if ( temp_p == NULL )
+ if(pci_request_regions(temp_p->pdev, "aic7xxx"))
+ {
+ printk("aic7xxx: <%s> at PCI %d/%d/%d\n",
+ board_names[aic_pdevs[i].board_name_index],
+ temp_p->pci_bus,
+ PCI_SLOT(temp_p->pci_device_fn),
+ PCI_FUNC(temp_p->pci_device_fn));
+ printk("aic7xxx: I/O ports already in use, ignoring.\n");
+ kfree(temp_p);
continue;
+ }
+
if (aic7xxx_verbose & VERBOSE_PROBE2)
printk("aic7xxx: <%s> at PCI %d/%d\n",
board_names[aic_pdevs[i].board_name_index],
pci_write_config_dword(pdev, DEVCONFIG, devconfig);
#endif /* AIC7XXX_STRICT_PCI_SETUP */
- if(temp_p->base && !request_region(temp_p->base, MAXREG - MINREG,
- "aic7xxx"))
- {
- printk("aic7xxx: <%s> at PCI %d/%d/%d\n",
- board_names[aic_pdevs[i].board_name_index],
- temp_p->pci_bus,
- PCI_SLOT(temp_p->pci_device_fn),
- PCI_FUNC(temp_p->pci_device_fn));
- printk("aic7xxx: I/O ports already in use, ignoring.\n");
- kfree(temp_p);
- temp_p = NULL;
- continue;
- }
-
temp_p->unpause = INTEN;
temp_p->pause = temp_p->unpause | PAUSE;
if ( ((temp_p->base == 0) &&
PCI_SLOT(temp_p->pci_device_fn),
PCI_FUNC(temp_p->pci_device_fn));
printk("aic7xxx: Controller disabled by BIOS, ignoring.\n");
- kfree(temp_p);
- temp_p = NULL;
- continue;
+ goto skip_pci_controller;
}
#ifdef MMAPIO
PCI_SLOT(temp_p->pci_device_fn),
PCI_FUNC(temp_p->pci_device_fn));
printk("aic7xxx: Controller disabled by BIOS, ignoring.\n");
- kfree(temp_p);
- temp_p = NULL;
- continue;
+ goto skip_pci_controller;
}
}
}
if (aic7xxx_chip_reset(temp_p) == -1)
{
- release_region(temp_p->base, MAXREG - MINREG);
- kfree(temp_p);
- temp_p = NULL;
- continue;
+ goto skip_pci_controller;
}
/*
* Very quickly put the term setting back into the register since
}
temp_p->next = NULL;
found++;
+ continue;
+skip_pci_controller:
+ pci_release_regions(temp_p->pdev);
+ kfree(temp_p);
} /* Found an Adaptec PCI device. */
else /* Well, we found one, but we couldn't get any memory */
{
if(p->irq)
free_irq(p->irq, p);
- if(p->base)
- release_region(p->base, MAXREG - MINREG);
#ifdef MMAPIO
if(p->maddr)
{
iounmap((void *) (((unsigned long) p->maddr) & PAGE_MASK));
}
#endif /* MMAPIO */
+ if(!p->pdev)
+ release_region(p->base, MAXREG - MINREG);
+ else
+ pci_release_regions(p->pdev);
prev = NULL;
next = first_aic7xxx;
while(next != NULL)