Commit b9d9a025 authored by Takashi Sakamoto's avatar Takashi Sakamoto

firewire: ohci: obsolete usage of deprecated API for MSI

The usage of the pair of pci_enable_msi() and pci_disable_msi() is
deprecated.

This commit uses the preferred pair of API for the purpose. The call of
pci_alloc_irq_vectors() can have a subeffect to change the return value
of pci_dev_msi_enabled().

Link: https://lore.kernel.org/r/20240331135037.191479-4-o-takashi@sakamocchi.jpSigned-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
parent d4cad416
......@@ -3631,7 +3631,7 @@ static int pci_probe(struct pci_dev *dev,
struct fw_ohci *ohci;
u32 bus_options, max_receive, link_speed, version;
u64 guid;
int i, err;
int i, flags, err;
size_t size;
if (dev->vendor == PCI_VENDOR_ID_PINNACLE_SYSTEMS) {
......@@ -3756,8 +3756,13 @@ static int pci_probe(struct pci_dev *dev,
guid = ((u64) reg_read(ohci, OHCI1394_GUIDHi) << 32) |
reg_read(ohci, OHCI1394_GUIDLo);
flags = PCI_IRQ_INTX;
if (!(ohci->quirks & QUIRK_NO_MSI))
pci_enable_msi(dev);
flags |= PCI_IRQ_MSI;
err = pci_alloc_irq_vectors(dev, 1, 1, flags);
if (err < 0)
return err;
err = request_threaded_irq(dev->irq, irq_handler, NULL,
pci_dev_msi_enabled(dev) ? 0 : IRQF_SHARED, ohci_driver_name,
ohci);
......@@ -3784,7 +3789,7 @@ static int pci_probe(struct pci_dev *dev,
fail_irq:
free_irq(dev->irq, ohci);
fail_msi:
pci_disable_msi(dev);
pci_free_irq_vectors(dev);
return err;
}
......@@ -3812,7 +3817,7 @@ static void pci_remove(struct pci_dev *dev)
software_reset(ohci);
free_irq(dev->irq, ohci);
pci_disable_msi(dev);
pci_free_irq_vectors(dev);
dev_notice(&dev->dev, "removing fw-ohci device\n");
}
......
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