Merge master.kernel.org:/home/rmk/linux-2.6-arm
[sfrench/cifs-2.6.git] / drivers / ata / libata-sff.c
index 8227c45109ecd95771a5cf7eb775fe715902971e..b7ac80b4b1fbd91135e2e6b8f8b83b4d4bf8d300 100644 (file)
@@ -248,7 +248,7 @@ void ata_bmdma_setup(struct ata_queued_cmd *qc)
  *     LOCKING:
  *     spin_lock_irqsave(host lock)
  */
-void ata_bmdma_start (struct ata_queued_cmd *qc)
+void ata_bmdma_start(struct ata_queued_cmd *qc)
 {
        struct ata_port *ap = qc->ap;
        u8 dmactl;
@@ -806,7 +806,10 @@ int ata_pci_init_one(struct pci_dev *pdev,
        if (rc)
                goto err_out;
 
-       if (!legacy_mode) {
+       if (!legacy_mode && pdev->irq) {
+               /* We may have no IRQ assigned in which case we can poll. This
+                  shouldn't happen on a sane system but robustness is cheap
+                  in this case */
                rc = devm_request_irq(dev, pdev->irq, pi->port_ops->irq_handler,
                                      IRQF_SHARED, DRV_NAME, host);
                if (rc)
@@ -814,7 +817,7 @@ int ata_pci_init_one(struct pci_dev *pdev,
 
                ata_port_desc(host->ports[0], "irq %d", pdev->irq);
                ata_port_desc(host->ports[1], "irq %d", pdev->irq);
-       } else {
+       } else if (legacy_mode) {
                if (!ata_port_is_dummy(host->ports[0])) {
                        rc = devm_request_irq(dev, ATA_PRIMARY_IRQ(pdev),
                                              pi->port_ops->irq_handler,