[PATCH 1/4] Revert "firewire: ohci: use devres for requested IRQ"

From: Takashi Sakamoto
Date: Sun Mar 31 2024 - 09:50:56 EST


This reverts commit 5a95f1ded28691e69f7d6718c5dcbc149613d431.

As long as allocating any device interrupt vector for MSI, it is
inconvenient to utilize managed device resources for IRQ requesting.

Signed-off-by: Takashi Sakamoto <o-takashi@xxxxxxxxxxxxx>
---
drivers/firewire/ohci.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c
index 7bc71f4be64a..f18019c5d220 100644
--- a/drivers/firewire/ohci.c
+++ b/drivers/firewire/ohci.c
@@ -3750,16 +3750,17 @@ static int pci_probe(struct pci_dev *dev,

if (!(ohci->quirks & QUIRK_NO_MSI))
pci_enable_msi(dev);
- err = devm_request_irq(&dev->dev, dev->irq, irq_handler,
- pci_dev_msi_enabled(dev) ? 0 : IRQF_SHARED, ohci_driver_name, ohci);
- if (err < 0) {
+ if (request_irq(dev->irq, irq_handler,
+ pci_dev_msi_enabled(dev) ? 0 : IRQF_SHARED,
+ ohci_driver_name, ohci)) {
ohci_err(ohci, "failed to allocate interrupt %d\n", dev->irq);
+ err = -EIO;
goto fail_msi;
}

err = fw_card_add(&ohci->card, max_receive, link_speed, guid);
if (err)
- goto fail_msi;
+ goto fail_irq;

version = reg_read(ohci, OHCI1394_Version) & 0x00ff00ff;
ohci_notice(ohci,
@@ -3772,8 +3773,9 @@ static int pci_probe(struct pci_dev *dev,

return 0;

+ fail_irq:
+ free_irq(dev->irq, ohci);
fail_msi:
- devm_free_irq(&dev->dev, dev->irq, ohci);
pci_disable_msi(dev);

return err;
@@ -3801,7 +3803,7 @@ static void pci_remove(struct pci_dev *dev)

software_reset(ohci);

- devm_free_irq(&dev->dev, dev->irq, ohci);
+ free_irq(dev->irq, ohci);
pci_disable_msi(dev);

dev_notice(&dev->dev, "removing fw-ohci device\n");
--
2.43.0