ide: use ide_pci_is_in_compatibility_mode() in ide_pci_init_{one,two}()

Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 5bae8bf4
...@@ -568,13 +568,11 @@ int ide_pci_init_one(struct pci_dev *dev, const struct ide_port_info *d, ...@@ -568,13 +568,11 @@ int ide_pci_init_one(struct pci_dev *dev, const struct ide_port_info *d,
goto out; goto out;
/* fixup IRQ */ /* fixup IRQ */
hw[1].irq = hw[0].irq = ret; if (ide_pci_is_in_compatibility_mode(dev)) {
if ((ret == 0 && (d->host_flags & IDE_HFLAG_LEGACY_IRQS)) ||
(d->host_flags & IDE_HFLAG_FORCE_LEGACY_IRQS)) {
hw[0].irq = pci_get_legacy_ide_irq(dev, 0); hw[0].irq = pci_get_legacy_ide_irq(dev, 0);
hw[1].irq = pci_get_legacy_ide_irq(dev, 1); hw[1].irq = pci_get_legacy_ide_irq(dev, 1);
} } else
hw[1].irq = hw[0].irq = ret;
ret = ide_host_register(host, d, hws); ret = ide_host_register(host, d, hws);
if (ret) if (ret)
...@@ -625,13 +623,11 @@ int ide_pci_init_two(struct pci_dev *dev1, struct pci_dev *dev2, ...@@ -625,13 +623,11 @@ int ide_pci_init_two(struct pci_dev *dev1, struct pci_dev *dev2,
goto out; goto out;
/* fixup IRQ */ /* fixup IRQ */
hw[i*2 + 1].irq = hw[i*2].irq = ret; if (ide_pci_is_in_compatibility_mode(pdev[i])) {
if ((ret == 0 && (d->host_flags & IDE_HFLAG_LEGACY_IRQS)) ||
(d->host_flags & IDE_HFLAG_FORCE_LEGACY_IRQS)) {
hw[i*2].irq = pci_get_legacy_ide_irq(pdev[i], 0); hw[i*2].irq = pci_get_legacy_ide_irq(pdev[i], 0);
hw[i*2 + 1].irq = pci_get_legacy_ide_irq(pdev[i], 1); hw[i*2 + 1].irq = pci_get_legacy_ide_irq(pdev[i], 1);
} } else
hw[i*2 + 1].irq = hw[i*2].irq = ret;
} }
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