Skip to content

Commit

Permalink
V4L/DVB: ngene: MSI cleanup
Browse files Browse the repository at this point in the history
MSI cleanup.

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Oliver Endriss authored and Mauro Carvalho Chehab committed Jun 1, 2010
1 parent 5a2a184 commit 478b3a4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/media/dvb/ngene/ngene-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1300,8 +1300,10 @@ static void ngene_stop(struct ngene *dev)
ngwritel(0, NGENE_EVENT);
ngwritel(0, NGENE_EVENT_HI);
free_irq(dev->pci_dev->irq, dev);
#ifdef CONFIG_PCI_MSI
if (dev->msi_enabled)
pci_disable_msi(dev->pci_dev);
#endif
}

static int ngene_start(struct ngene *dev)
Expand Down Expand Up @@ -1339,7 +1341,7 @@ static int ngene_start(struct ngene *dev)

#ifdef CONFIG_PCI_MSI
/* enable MSI if kernel and card support it */
if (dev->card_info->msi_supported) {
if (pci_msi_enabled() && dev->card_info->msi_supported) {
ngwritel(0, NGENE_INT_ENABLE);
free_irq(dev->pci_dev->irq, dev);
stat = pci_enable_msi(dev->pci_dev);
Expand Down Expand Up @@ -1391,9 +1393,11 @@ static int ngene_start(struct ngene *dev)
fail:
ngwritel(0, NGENE_INT_ENABLE);
free_irq(dev->pci_dev->irq, dev);
#ifdef CONFIG_PCI_MSI
fail2:
if (dev->msi_enabled)
pci_disable_msi(dev->pci_dev);
#endif
return stat;
}

Expand Down

0 comments on commit 478b3a4

Please sign in to comment.