LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] libata-sff: Kiss ATA_PRIMARY_* goodbye
@ 2007-07-03 14:58 Alan Cox
0 siblings, 0 replies; only message in thread
From: Alan Cox @ 2007-07-03 14:58 UTC (permalink / raw)
To: jeff, linux-ide, linux-kernel
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 <alan@redhat.com>
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-07-03 14:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-03 14:58 [PATCH] libata-sff: Kiss ATA_PRIMARY_* goodbye Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).