Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] media/cobalt: use pci_irq_allocate_vectors

Simply the interrupt setup by using the new PCI layer helpers.

Despite using pci_enable_msi_range, this driver was only requesting a
single MSI vector anyway.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>

authored by

Christoph Hellwig and committed by
Mauro Carvalho Chehab
78ccbf9f f60f3560

+2 -8
+2 -6
drivers/media/pci/cobalt/cobalt-driver.c
··· 308 308 static void cobalt_free_msi(struct cobalt *cobalt, struct pci_dev *pci_dev) 309 309 { 310 310 free_irq(pci_dev->irq, (void *)cobalt); 311 - 312 - if (cobalt->msi_enabled) 313 - pci_disable_msi(pci_dev); 311 + pci_free_irq_vectors(pci_dev); 314 312 } 315 313 316 314 static int cobalt_setup_pci(struct cobalt *cobalt, struct pci_dev *pci_dev, ··· 385 387 from being generated. */ 386 388 cobalt_set_interrupt(cobalt, false); 387 389 388 - if (pci_enable_msi_range(pci_dev, 1, 1) < 1) { 390 + if (pci_alloc_irq_vectors(pci_dev, 1, 1, PCI_IRQ_MSI) < 1) { 389 391 cobalt_err("Could not enable MSI\n"); 390 - cobalt->msi_enabled = false; 391 392 ret = -EIO; 392 393 goto err_release; 393 394 } 394 395 msi_config_show(cobalt, pci_dev); 395 - cobalt->msi_enabled = true; 396 396 397 397 /* Register IRQ */ 398 398 if (request_irq(pci_dev->irq, cobalt_irq_handler, IRQF_SHARED,
-2
drivers/media/pci/cobalt/cobalt-driver.h
··· 287 287 u32 irq_none; 288 288 u32 irq_full_fifo; 289 289 290 - bool msi_enabled; 291 - 292 290 /* omnitek dma */ 293 291 int dma_channels; 294 292 int first_fifo_channel;