From: Christoph Hellwig <hch@lst.de>
To: hans.verkuil@cisco.com, brking@us.ibm.com,
haver@linux.vnet.ibm.com, ching2048@areca.com.tw, axboe@fb.com,
alex.williamson@redhat.com
Cc: kvm@vger.kernel.org, linux-scsi@vger.kernel.org,
linux-block@vger.kernel.org, linux-media@vger.kernel.org,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 6/6] media/cobalt: use pci_irq_allocate_vectors
Date: Sun, 11 Sep 2016 15:31:28 +0200 [thread overview]
Message-ID: <1473600688-24043-7-git-send-email-hch@lst.de> (raw)
In-Reply-To: <1473600688-24043-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 476f7f0..5a0a9e4 100644
--- a/drivers/media/pci/cobalt/cobalt-driver.c
+++ b/drivers/media/pci/cobalt/cobalt-driver.c
@@ -307,9 +307,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,
@@ -386,14 +384,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:[~2016-09-11 13:31 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-11 13:31 replace pci_enable_msi_{exact_range} with pci_alloc_irq_vectors Christoph Hellwig
2016-09-11 13:31 ` [PATCH 1/6] arcmsr: use pci_alloc_irq_vectors Christoph Hellwig
2016-09-19 20:45 ` Martin K. Petersen
2016-10-11 20:16 ` Martin K. Petersen
2016-09-11 13:31 ` [PATCH 2/6] ipr: use pci_irq_allocate_vectors Christoph Hellwig
2016-09-19 20:44 ` Martin K. Petersen
2016-09-29 14:01 ` Brian King
2016-09-29 15:32 ` Christoph Hellwig
2016-10-11 20:18 ` Martin K. Petersen
2016-09-11 13:31 ` [PATCH 3/6] skd: use pci_alloc_irq_vectors Christoph Hellwig
2016-09-11 13:31 ` [PATCH 4/6] vfio_pci: use pci_irq_allocate_vectors Christoph Hellwig
2016-09-29 19:21 ` Alex Williamson
2016-09-29 19:24 ` Christoph Hellwig
2016-09-29 19:27 ` Alex Williamson
2016-09-11 13:31 ` [PATCH 5/6] genwqe: " Christoph Hellwig
2016-09-29 18:28 ` Gabriel Krisman Bertazi
2016-09-29 18:37 ` Christoph Hellwig
2016-09-29 18:45 ` Gabriel Krisman Bertazi
2016-09-29 18:48 ` Christoph Hellwig
2016-09-29 18:51 ` Gabriel Krisman Bertazi
2016-09-11 13:31 ` Christoph Hellwig [this message]
2016-09-16 8:01 ` [PATCH 6/6] media/cobalt: " Hans Verkuil
2016-09-16 8:31 ` Christoph Hellwig
2016-12-14 10:29 ` Christoph Hellwig
2016-12-14 10:37 ` Hans Verkuil
2016-12-14 10:47 ` Christoph Hellwig
2016-12-14 10:52 ` Hans Verkuil
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=1473600688-24043-7-git-send-email-hch@lst.de \
--to=hch@lst.de \
--cc=alex.williamson@redhat.com \
--cc=axboe@fb.com \
--cc=brking@us.ibm.com \
--cc=ching2048@areca.com.tw \
--cc=hans.verkuil@cisco.com \
--cc=haver@linux.vnet.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-scsi@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).