Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 374700
b: refs/heads/master
c: 247fd50
h: refs/heads/master
v: v3
  • Loading branch information
Peter Hurley authored and Stefan Richter committed Apr 28, 2013
1 parent c58bd79 commit f4478e5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cfb0c9d1ffbf930a4a852f178b161c522b21b0ab
refs/heads/master: 247fd50b5953d2b07832a07bd1d1c3b8e221fe9e
38 changes: 16 additions & 22 deletions trunk/drivers/firewire/ohci.c
Original file line number Diff line number Diff line change
Expand Up @@ -2246,7 +2246,6 @@ static int ohci_enable(struct fw_card *card,
const __be32 *config_rom, size_t length)
{
struct fw_ohci *ohci = fw_ohci(card);
struct pci_dev *dev = to_pci_dev(card->device);
u32 lps, version, irqs;
int i, ret;

Expand Down Expand Up @@ -2382,24 +2381,6 @@ static int ohci_enable(struct fw_card *card,

reg_write(ohci, OHCI1394_AsReqFilterHiSet, 0x80000000);

if (!(ohci->quirks & QUIRK_NO_MSI))
pci_enable_msi(dev);
if (request_irq(dev->irq, irq_handler,
pci_dev_msi_enabled(dev) ? 0 : IRQF_SHARED,
ohci_driver_name, ohci)) {
dev_err(card->device, "failed to allocate interrupt %d\n",
dev->irq);
pci_disable_msi(dev);

if (config_rom) {
dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE,
ohci->next_config_rom,
ohci->next_config_rom_bus);
ohci->next_config_rom = NULL;
}
return -EIO;
}

irqs = OHCI1394_reqTxComplete | OHCI1394_respTxComplete |
OHCI1394_RQPkt | OHCI1394_RSPkt |
OHCI1394_isochTx | OHCI1394_isochRx |
Expand Down Expand Up @@ -3675,9 +3656,20 @@ static int pci_probe(struct pci_dev *dev,
guid = ((u64) reg_read(ohci, OHCI1394_GUIDHi) << 32) |
reg_read(ohci, OHCI1394_GUIDLo);

if (!(ohci->quirks & QUIRK_NO_MSI))
pci_enable_msi(dev);
if (request_irq(dev->irq, irq_handler,
pci_dev_msi_enabled(dev) ? 0 : IRQF_SHARED,
ohci_driver_name, ohci)) {
dev_err(&dev->dev, "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_contexts;
goto fail_irq;

version = reg_read(ohci, OHCI1394_Version) & 0x00ff00ff;
dev_notice(&dev->dev,
Expand All @@ -3688,6 +3680,10 @@ static int pci_probe(struct pci_dev *dev,

return 0;

fail_irq:
free_irq(dev->irq, ohci);
fail_msi:
pci_disable_msi(dev);
fail_contexts:
kfree(ohci->ir_context_list);
kfree(ohci->it_context_list);
Expand Down Expand Up @@ -3763,8 +3759,6 @@ static int pci_suspend(struct pci_dev *dev, pm_message_t state)
int err;

software_reset(ohci);
free_irq(dev->irq, ohci);
pci_disable_msi(dev);
err = pci_save_state(dev);
if (err) {
dev_err(&dev->dev, "pci_save_state failed\n");
Expand Down

0 comments on commit f4478e5

Please sign in to comment.