From: Christoph Hellwig <hch@lst.de>
To: linux-pci@vger.kernel.org
Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>,
netdev@vger.kernel.org, linux-media@vger.kernel.org
Subject: [PATCH 1/3] media/cobalt: use pci_irq_allocate_vectors
Date: Mon, 9 Jan 2017 21:37:38 +0100 [thread overview]
Message-ID: <1483994260-19797-2-git-send-email-hch@lst.de> (raw)
In-Reply-To: <1483994260-19797-1-git-send-email-hch@lst.de>
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>
---
drivers/media/pci/cobalt/cobalt-driver.c | 8 ++------
drivers/media/pci/cobalt/cobalt-driver.h | 2 --
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/media/pci/cobalt/cobalt-driver.c b/drivers/media/pci/cobalt/cobalt-driver.c
index 9796340..d5c911c 100644
--- a/drivers/media/pci/cobalt/cobalt-driver.c
+++ b/drivers/media/pci/cobalt/cobalt-driver.c
@@ -308,9 +308,7 @@ static void cobalt_pci_iounmap(struct cobalt *cobalt, struct pci_dev *pci_dev)
static void cobalt_free_msi(struct cobalt *cobalt, struct pci_dev *pci_dev)
{
free_irq(pci_dev->irq, (void *)cobalt);
-
- if (cobalt->msi_enabled)
- pci_disable_msi(pci_dev);
+ pci_free_irq_vectors(pci_dev);
}
static int cobalt_setup_pci(struct cobalt *cobalt, struct pci_dev *pci_dev,
@@ -387,14 +385,12 @@ static int cobalt_setup_pci(struct cobalt *cobalt, struct pci_dev *pci_dev,
from being generated. */
cobalt_set_interrupt(cobalt, false);
- if (pci_enable_msi_range(pci_dev, 1, 1) < 1) {
+ if (pci_alloc_irq_vectors(pci_dev, 1, 1, PCI_IRQ_MSI) < 1) {
cobalt_err("Could not enable MSI\n");
- cobalt->msi_enabled = false;
ret = -EIO;
goto err_release;
}
msi_config_show(cobalt, pci_dev);
- cobalt->msi_enabled = true;
/* Register IRQ */
if (request_irq(pci_dev->irq, cobalt_irq_handler, IRQF_SHARED,
diff --git a/drivers/media/pci/cobalt/cobalt-driver.h b/drivers/media/pci/cobalt/cobalt-driver.h
index ed00dc9..00f773e 100644
--- a/drivers/media/pci/cobalt/cobalt-driver.h
+++ b/drivers/media/pci/cobalt/cobalt-driver.h
@@ -287,8 +287,6 @@ struct cobalt {
u32 irq_none;
u32 irq_full_fifo;
- bool msi_enabled;
-
/* omnitek dma */
int dma_channels;
int first_fifo_channel;
--
2.1.4
next prev parent reply other threads:[~2017-01-09 20:37 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-09 20:37 kill off pci_enable_msi_{exact,range} Christoph Hellwig
2017-01-09 20:37 ` Christoph Hellwig [this message]
2017-01-09 20:37 ` [PATCH 2/3] xgbe: switch to pci_irq_alloc_vectors Christoph Hellwig
2017-01-10 18:40 ` Tom Lendacky
2017-01-11 9:03 ` Christoph Hellwig
2017-01-11 16:46 ` Tom Lendacky
2017-01-09 20:37 ` [PATCH 3/3] PCI/msi: remove pci_enable_msi_{exact,range} Christoph Hellwig
2017-01-11 1:20 ` kill off pci_enable_msi_{exact,range} David Miller
2017-01-12 21:29 ` Bjorn Helgaas
2017-01-13 7:55 ` Christoph Hellwig
2017-01-13 8:05 ` Christoph Hellwig
2017-01-13 17:13 ` Bjorn Helgaas
2017-01-13 17:15 ` Christoph Hellwig
2017-01-13 21:28 ` Tom Lendacky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1483994260-19797-2-git-send-email-hch@lst.de \
--to=hch@lst.de \
--cc=linux-media@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mchehab@s-opensource.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).