ide: handle IDE_HFLAG[_FORCE]_LEGACY_IRQS in ide_pci_init_{one,two}()

Move handling of IDE_HFLAG[_FORCE]_LEGACY_IRQS from ide_init_port()
to ide_pci_init_{one,two}().

There should be no functional changes caused by this patch.
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 1b166ae7
...@@ -1183,10 +1183,6 @@ static void ide_init_port(ide_hwif_t *hwif, unsigned int port, ...@@ -1183,10 +1183,6 @@ static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
if (d->init_iops) if (d->init_iops)
d->init_iops(hwif); d->init_iops(hwif);
if ((!hwif->irq && (d->host_flags & IDE_HFLAG_LEGACY_IRQS)) ||
(d->host_flags & IDE_HFLAG_FORCE_LEGACY_IRQS))
hwif->irq = port ? 15 : 14;
/* ->host_flags may be set by ->init_iops (or even earlier...) */ /* ->host_flags may be set by ->init_iops (or even earlier...) */
hwif->host_flags |= d->host_flags; hwif->host_flags |= d->host_flags;
hwif->pio_mask = d->pio_mask; hwif->pio_mask = d->pio_mask;
......
...@@ -570,6 +570,12 @@ int ide_pci_init_one(struct pci_dev *dev, const struct ide_port_info *d, ...@@ -570,6 +570,12 @@ int ide_pci_init_one(struct pci_dev *dev, const struct ide_port_info *d,
/* fixup IRQ */ /* fixup IRQ */
hw[1].irq = hw[0].irq = ret; hw[1].irq = hw[0].irq = ret;
if ((ret == 0 && (d->host_flags & IDE_HFLAG_LEGACY_IRQS)) ||
(d->host_flags & IDE_HFLAG_FORCE_LEGACY_IRQS)) {
hw[0].irq = 14;
hw[1].irq = 15;
}
ret = ide_host_register(host, d, hws); ret = ide_host_register(host, d, hws);
if (ret) if (ret)
ide_host_free(host); ide_host_free(host);
...@@ -620,6 +626,12 @@ int ide_pci_init_two(struct pci_dev *dev1, struct pci_dev *dev2, ...@@ -620,6 +626,12 @@ int ide_pci_init_two(struct pci_dev *dev1, struct pci_dev *dev2,
/* fixup IRQ */ /* fixup IRQ */
hw[i*2 + 1].irq = hw[i*2].irq = ret; hw[i*2 + 1].irq = hw[i*2].irq = ret;
if ((ret == 0 && (d->host_flags & IDE_HFLAG_LEGACY_IRQS)) ||
(d->host_flags & IDE_HFLAG_FORCE_LEGACY_IRQS)) {
hw[i*2].irq = 14;
hw[i*2 + 1].irq = 15;
}
} }
ret = ide_host_register(host, d, hws); ret = ide_host_register(host, d, hws);
......
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