aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ata_piix.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/ata_piix.c')
-rw-r--r--drivers/scsi/ata_piix.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c
index fb28c1261848..deec0cef88d9 100644
--- a/drivers/scsi/ata_piix.c
+++ b/drivers/scsi/ata_piix.c
@@ -583,8 +583,7 @@ static void pci_enable_intx(struct pci_dev *pdev)
583#define AHCI_ENABLE (1 << 31) 583#define AHCI_ENABLE (1 << 31)
584static int piix_disable_ahci(struct pci_dev *pdev) 584static int piix_disable_ahci(struct pci_dev *pdev)
585{ 585{
586 void *mmio; 586 void __iomem *mmio;
587 unsigned long addr;
588 u32 tmp; 587 u32 tmp;
589 int rc = 0; 588 int rc = 0;
590 589
@@ -592,11 +591,11 @@ static int piix_disable_ahci(struct pci_dev *pdev)
592 * works because this device is usually set up by BIOS. 591 * works because this device is usually set up by BIOS.
593 */ 592 */
594 593
595 addr = pci_resource_start(pdev, AHCI_PCI_BAR); 594 if (!pci_resource_start(pdev, AHCI_PCI_BAR) ||
596 if (!addr || !pci_resource_len(pdev, AHCI_PCI_BAR)) 595 !pci_resource_len(pdev, AHCI_PCI_BAR))
597 return 0; 596 return 0;
598 597
599 mmio = ioremap(addr, 64); 598 mmio = pci_iomap(pdev, AHCI_PCI_BAR, 64);
600 if (!mmio) 599 if (!mmio)
601 return -ENOMEM; 600 return -ENOMEM;
602 601
@@ -610,7 +609,7 @@ static int piix_disable_ahci(struct pci_dev *pdev)
610 rc = -EIO; 609 rc = -EIO;
611 } 610 }
612 611
613 iounmap(mmio); 612 pci_iounmap(pdev, mmio);
614 return rc; 613 return rc;
615} 614}
616 615