aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_mpiix.c
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2007-02-05 13:08:55 -0500
committerJeff Garzik <jeff@garzik.org>2007-02-09 17:39:39 -0500
commit92ae78493f5f3de323652f3ea0ec8b7b2839c3d2 (patch)
tree5ea90b3aa3a40997aaccd868609db7fe5f83fafc /drivers/ata/pata_mpiix.c
parent7b4f1a13f708a7b061185d86aae201f3195db47a (diff)
(2.6.20) pata_mpiix: probing cleanup (resend)
MPIIX has only single channel IDE which can be configured for either primary or secondary legacy I/O ports and IRQ. So, get rid of the unneeded second probe entry in mpiix_init_one() and of the invalid (but unused anyway) enable bits in mpiix_pre_reset(). Warning: this cleanup has only been compile-tested... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/pata_mpiix.c')
-rw-r--r--drivers/ata/pata_mpiix.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/ata/pata_mpiix.c b/drivers/ata/pata_mpiix.c
index 4e97a7efccef..ca8c965179b1 100644
--- a/drivers/ata/pata_mpiix.c
+++ b/drivers/ata/pata_mpiix.c
@@ -35,7 +35,7 @@
35#include <linux/libata.h> 35#include <linux/libata.h>
36 36
37#define DRV_NAME "pata_mpiix" 37#define DRV_NAME "pata_mpiix"
38#define DRV_VERSION "0.7.4" 38#define DRV_VERSION "0.7.5"
39 39
40enum { 40enum {
41 IDETIM = 0x6C, /* IDE control register */ 41 IDETIM = 0x6C, /* IDE control register */
@@ -49,12 +49,9 @@ enum {
49static int mpiix_pre_reset(struct ata_port *ap) 49static int mpiix_pre_reset(struct ata_port *ap)
50{ 50{
51 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 51 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
52 static const struct pci_bits mpiix_enable_bits[] = { 52 static const struct pci_bits mpiix_enable_bits = { 0x6D, 1, 0x80, 0x80 };
53 { 0x6D, 1, 0x80, 0x80 },
54 { 0x6F, 1, 0x80, 0x80 }
55 };
56 53
57 if (!pci_test_config_bits(pdev, &mpiix_enable_bits[ap->port_no])) 54 if (!pci_test_config_bits(pdev, &mpiix_enable_bits))
58 return -ENOENT; 55 return -ENOENT;
59 ap->cbl = ATA_CBL_PATA40; 56 ap->cbl = ATA_CBL_PATA40;
60 return ata_std_prereset(ap); 57 return ata_std_prereset(ap);
@@ -219,6 +216,7 @@ static int mpiix_init_one(struct pci_dev *dev, const struct pci_device_id *id)
219 if (!(idetim & ENABLED)) 216 if (!(idetim & ENABLED))
220 return -ENODEV; 217 return -ENODEV;
221 218
219 /* See if it's primary or secondary channel... */
222 if (!(idetim & SECONDARY)) { 220 if (!(idetim & SECONDARY)) {
223 irq = 14; 221 irq = 14;
224 cmd_addr = devm_ioport_map(&dev->dev, 0x1F0, 8); 222 cmd_addr = devm_ioport_map(&dev->dev, 0x1F0, 8);
@@ -243,10 +241,11 @@ static int mpiix_init_one(struct pci_dev *dev, const struct pci_device_id *id)
243 probe.port_ops = &mpiix_port_ops; 241 probe.port_ops = &mpiix_port_ops;
244 probe.sht = &mpiix_sht; 242 probe.sht = &mpiix_sht;
245 probe.pio_mask = 0x1F; 243 probe.pio_mask = 0x1F;
246 probe.irq = irq;
247 probe.irq_flags = SA_SHIRQ; 244 probe.irq_flags = SA_SHIRQ;
248 probe.port_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST; 245 probe.port_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST;
249 probe.n_ports = 1; 246 probe.n_ports = 1;
247
248 probe.irq = irq;
250 probe.port[0].cmd_addr = cmd_addr; 249 probe.port[0].cmd_addr = cmd_addr;
251 probe.port[0].ctl_addr = ctl_addr; 250 probe.port[0].ctl_addr = ctl_addr;
252 probe.port[0].altstatus_addr = ctl_addr; 251 probe.port[0].altstatus_addr = ctl_addr;