[PATCH] libata-sff: Kiss ATA_PRIMARY_* goodbye

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We've been setting the PCI resources correctly in the PCI layer for some
time so remove this special casing. 

Signed-off-by: Alan Cox <[email protected]>

diff -u --new-file --exclude-from /usr/src/exclude --recursive linux.vanilla-2.6.22-rc6-mm1/drivers/ata/libata-sff.c linux-2.6.22-rc6-mm1/drivers/ata/libata-sff.c
--- linux.vanilla-2.6.22-rc6-mm1/drivers/ata/libata-sff.c	2007-07-02 20:48:49.000000000 +0100
+++ linux-2.6.22-rc6-mm1/drivers/ata/libata-sff.c	2007-07-03 13:15:48.000000000 +0100
@@ -774,16 +774,13 @@
 				struct ata_legacy_devres *legacy_dr)
 {
 	struct ata_host *host = ap->host;
+	struct device *gdev = host->dev;
+	struct pci_dev *pdev = to_pci_dev(gdev);
 	int port_no = ap->port_no;
 	unsigned long cmd_port, ctl_port;
 
-	if (port_no == 0) {
-		cmd_port = ATA_PRIMARY_CMD;
-		ctl_port = ATA_PRIMARY_CTL;
-	} else {
-		cmd_port = ATA_SECONDARY_CMD;
-		ctl_port = ATA_SECONDARY_CTL;
-	}
+	cmd_port = pci_resource_start(pdev, port_no * 2);
+	ctl_port = pci_resource_start(pdev, port_no * 2 + 1);
 
 	/* request cmd_port */
 	if (request_region(cmd_port, 8, "libata"))
diff -u --new-file --exclude-from /usr/src/exclude --recursive linux.vanilla-2.6.22-rc6-mm1/include/asm-generic/libata-portmap.h linux-2.6.22-rc6-mm1/include/asm-generic/libata-portmap.h
--- linux.vanilla-2.6.22-rc6-mm1/include/asm-generic/libata-portmap.h	2007-07-02 20:47:33.000000000 +0100
+++ linux-2.6.22-rc6-mm1/include/asm-generic/libata-portmap.h	2007-07-03 13:16:13.000000000 +0100
@@ -1,12 +1,7 @@
 #ifndef __ASM_GENERIC_LIBATA_PORTMAP_H
 #define __ASM_GENERIC_LIBATA_PORTMAP_H
 
-#define ATA_PRIMARY_CMD		0x1F0
-#define ATA_PRIMARY_CTL		0x3F6
 #define ATA_PRIMARY_IRQ(dev)	14
-
-#define ATA_SECONDARY_CMD	0x170
-#define ATA_SECONDARY_CTL	0x376
 #define ATA_SECONDARY_IRQ(dev)	15
 
 #endif
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux