]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/libata-bmdma.c
Merge tag 'r8169-20060920-00' of git://electric-eye.fr.zoreil.com/home/romieu/linux...
[linux-2.6-omap-h63xx.git] / drivers / scsi / libata-bmdma.c
index 4bc05371737ccfc40cc7f39c49c91f63585fbaf8..9ce221f25954426af69ce124bb11a4beaf0feff2 100644 (file)
@@ -32,7 +32,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/libata.h>
@@ -715,7 +714,6 @@ void ata_bmdma_drive_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
                        ata_reset_fn_t softreset, ata_reset_fn_t hardreset,
                        ata_postreset_fn_t postreset)
 {
-       struct ata_host_set *host_set = ap->host_set;
        struct ata_eh_context *ehc = &ap->eh_context;
        struct ata_queued_cmd *qc;
        unsigned long flags;
@@ -726,7 +724,7 @@ void ata_bmdma_drive_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
                qc = NULL;
 
        /* reset PIO HSM and stop DMA engine */
-       spin_lock_irqsave(&host_set->lock, flags);
+       spin_lock_irqsave(ap->lock, flags);
 
        ap->hsm_task_state = HSM_ST_IDLE;
 
@@ -755,7 +753,7 @@ void ata_bmdma_drive_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
        ata_chk_status(ap);
        ap->ops->irq_clear(ap);
 
-       spin_unlock_irqrestore(&host_set->lock, flags);
+       spin_unlock_irqrestore(ap->lock, flags);
 
        if (thaw)
                ata_eh_thaw_port(ap);
@@ -855,7 +853,7 @@ ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int
                return NULL;
 
        probe_ent->irq = pdev->irq;
-       probe_ent->irq_flags = SA_SHIRQ;
+       probe_ent->irq_flags = IRQF_SHARED;
        probe_ent->private_data = port[0]->private_data;
 
        if (ports & ATA_PORT_PRIMARY) {
@@ -1076,10 +1074,21 @@ int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info,
 
        /* FIXME: check ata_device_add return */
        if (legacy_mode) {
-               if (legacy_mode & (1 << 0))
+               struct device *dev = &pdev->dev;
+               struct ata_host_set *host_set = NULL;
+
+               if (legacy_mode & (1 << 0)) {
                        ata_device_add(probe_ent);
-               if (legacy_mode & (1 << 1))
+                       host_set = dev_get_drvdata(dev);
+               }
+
+               if (legacy_mode & (1 << 1)) {
                        ata_device_add(probe_ent2);
+                       if (host_set) {
+                               host_set->next = dev_get_drvdata(dev);
+                               dev_set_drvdata(dev, host_set);
+                       }
+               }
        } else
                ata_device_add(probe_ent);