-static int __init dmx3191d_detect(Scsi_Host_Template *tmpl) {
- int boards = 0;
- struct Scsi_Host *instance = NULL;
- struct pci_dev *pdev = NULL;
-
- tmpl->proc_name = DMX3191D_DRIVER_NAME;
-
- while ((pdev = pci_find_device(PCI_VENDOR_ID_DOMEX,
- PCI_DEVICE_ID_DOMEX_DMX3191D, pdev))) {
-
- unsigned long port;
- if (pci_enable_device(pdev))
- continue;
-
- port = pci_resource_start (pdev, 0);
-
- if (!request_region(port, DMX3191D_REGION, DMX3191D_DRIVER_NAME)) {
- printk(KERN_ERR "dmx3191: region 0x%lx-0x%lx already reserved\n",
- port, port + DMX3191D_REGION);
- continue;
- }
-
- instance = scsi_register(tmpl, sizeof(struct NCR5380_hostdata));
- if(instance == NULL)
- {
- release_region(port, DMX3191D_REGION);
- continue;
- }
- scsi_set_device(instance, &pdev->dev);
- instance->io_port = port;
- instance->irq = pdev->irq;
- NCR5380_init(instance, FLAG_NO_PSEUDO_DMA | FLAG_DTC3181E);
-
- if (request_irq(pdev->irq, dmx3191d_intr, SA_SHIRQ,
- DMX3191D_DRIVER_NAME, instance)) {
- printk(KERN_WARNING "dmx3191: IRQ %d not available - switching to polled mode.\n", pdev->irq);
- /* Steam powered scsi controllers run without an IRQ
- anyway */
- instance->irq = SCSI_IRQ_NONE;
- }
-
- boards++;
+static struct scsi_host_template dmx3191d_driver_template = {
+ .proc_name = DMX3191D_DRIVER_NAME,
+ .name = "Domex DMX3191D",
+ .queuecommand = NCR5380_queue_command,
+ .eh_abort_handler = NCR5380_abort,
+ .eh_bus_reset_handler = NCR5380_bus_reset,
+ .can_queue = 32,
+ .this_id = 7,
+ .sg_tablesize = SG_ALL,
+ .cmd_per_lun = 2,
+ .use_clustering = DISABLE_CLUSTERING,
+};
+
+static int __devinit dmx3191d_probe_one(struct pci_dev *pdev,
+ const struct pci_device_id *id)
+{
+ struct Scsi_Host *shost;
+ unsigned long io;
+ int error = -ENODEV;
+
+ if (pci_enable_device(pdev))
+ goto out;
+
+ io = pci_resource_start(pdev, 0);
+ if (!request_region(io, DMX3191D_REGION_LEN, DMX3191D_DRIVER_NAME)) {
+ printk(KERN_ERR "dmx3191: region 0x%lx-0x%lx already reserved\n",
+ io, io + DMX3191D_REGION_LEN);
+ goto out_disable_device;