Commit 92ae7849 authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by Jeff Garzik

(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: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 7b4f1a13
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include <linux/libata.h> #include <linux/libata.h>
#define DRV_NAME "pata_mpiix" #define DRV_NAME "pata_mpiix"
#define DRV_VERSION "0.7.4" #define DRV_VERSION "0.7.5"
enum { enum {
IDETIM = 0x6C, /* IDE control register */ IDETIM = 0x6C, /* IDE control register */
...@@ -49,12 +49,9 @@ enum { ...@@ -49,12 +49,9 @@ enum {
static int mpiix_pre_reset(struct ata_port *ap) static int mpiix_pre_reset(struct ata_port *ap)
{ {
struct pci_dev *pdev = to_pci_dev(ap->host->dev); struct pci_dev *pdev = to_pci_dev(ap->host->dev);
static const struct pci_bits mpiix_enable_bits[] = { static const struct pci_bits mpiix_enable_bits = { 0x6D, 1, 0x80, 0x80 };
{ 0x6D, 1, 0x80, 0x80 },
{ 0x6F, 1, 0x80, 0x80 }
};
if (!pci_test_config_bits(pdev, &mpiix_enable_bits[ap->port_no])) if (!pci_test_config_bits(pdev, &mpiix_enable_bits))
return -ENOENT; return -ENOENT;
ap->cbl = ATA_CBL_PATA40; ap->cbl = ATA_CBL_PATA40;
return ata_std_prereset(ap); 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,6 +216,7 @@ static int mpiix_init_one(struct pci_dev *dev, const struct pci_device_id *id)
if (!(idetim & ENABLED)) if (!(idetim & ENABLED))
return -ENODEV; return -ENODEV;
/* See if it's primary or secondary channel... */
if (!(idetim & SECONDARY)) { if (!(idetim & SECONDARY)) {
irq = 14; irq = 14;
cmd_addr = devm_ioport_map(&dev->dev, 0x1F0, 8); 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,10 +241,11 @@ static int mpiix_init_one(struct pci_dev *dev, const struct pci_device_id *id)
probe.port_ops = &mpiix_port_ops; probe.port_ops = &mpiix_port_ops;
probe.sht = &mpiix_sht; probe.sht = &mpiix_sht;
probe.pio_mask = 0x1F; probe.pio_mask = 0x1F;
probe.irq = irq;
probe.irq_flags = SA_SHIRQ; probe.irq_flags = SA_SHIRQ;
probe.port_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST; probe.port_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST;
probe.n_ports = 1; probe.n_ports = 1;
probe.irq = irq;
probe.port[0].cmd_addr = cmd_addr; probe.port[0].cmd_addr = cmd_addr;
probe.port[0].ctl_addr = ctl_addr; probe.port[0].ctl_addr = ctl_addr;
probe.port[0].altstatus_addr = ctl_addr; probe.port[0].altstatus_addr = ctl_addr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment