aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/setup-pci.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-07-20 01:11:55 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-07-20 01:11:55 +0200
commita5d8c5c834d3cabf4b7b477c3f6ee923c25026fc (patch)
tree19fc04470569a3c2f227d5aac3078a15ac65bb32 /drivers/ide/setup-pci.c
parent2229833c1365346b64357a9263fa724f74f5e376 (diff)
downloadkernel_samsung_smdk4412-a5d8c5c834d3cabf4b7b477c3f6ee923c25026fc.zip
kernel_samsung_smdk4412-a5d8c5c834d3cabf4b7b477c3f6ee923c25026fc.tar.gz
kernel_samsung_smdk4412-a5d8c5c834d3cabf4b7b477c3f6ee923c25026fc.tar.bz2
ide: add ide_pci_device_t.host_flags (take 2)
* Rename ide_pci_device_t.flags to ide_pci_device_t.host_flags and IDEPCI_FLAG_ISA_PORTS flag to IDE_HFLAG_ISA_PORTS. * Add IDE_HFLAG_SINGLE flag for single channel devices. * Convert core code and all IDE PCI drivers to use IDE_HFLAG_SINGLE and remove no longer needed ide_pci_device_t.channels field. v2: * Fix issues noticed by Sergei: - correct code alignment in scc_pata.c - s/IDE_HFLAG_SINGLE/~IDE_HFLAG_SINGLE/ in serverworks.c Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/setup-pci.c')
-rw-r--r--drivers/ide/setup-pci.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index c88d332..bfe1f4e 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -407,7 +407,7 @@ static ide_hwif_t *ide_hwif_configure(struct pci_dev *dev, ide_pci_device_t *d,
unsigned long ctl = 0, base = 0;
ide_hwif_t *hwif;
- if ((d->flags & IDEPCI_FLAG_ISA_PORTS) == 0) {
+ if ((d->host_flags & IDE_HFLAG_ISA_PORTS) == 0) {
/* Possibly we should fail if these checks report true */
ide_pci_check_iomem(dev, d, 2*port);
ide_pci_check_iomem(dev, d, 2*port+1);
@@ -571,7 +571,7 @@ out:
void ide_pci_setup_ports(struct pci_dev *dev, ide_pci_device_t *d, int pciirq, ata_index_t *index)
{
- int port;
+ int channels = (d->host_flags & IDE_HFLAG_SINGLE) ? 1 : 2, port;
int at_least_one_hwif_enabled = 0;
ide_hwif_t *hwif, *mate = NULL;
u8 tmp;
@@ -582,16 +582,13 @@ void ide_pci_setup_ports(struct pci_dev *dev, ide_pci_device_t *d, int pciirq, a
* Set up the IDE ports
*/
- for (port = 0; port <= 1; ++port) {
+ for (port = 0; port < channels; ++port) {
ide_pci_enablebit_t *e = &(d->enablebits[port]);
if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) ||
(tmp & e->mask) != e->val))
continue; /* port not enabled */
- if (d->channels <= port)
- break;
-
if ((hwif = ide_hwif_configure(dev, d, mate, port, pciirq)) == NULL)
continue;