linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gavin Shan <shangw@linux.vnet.ibm.com>
To: linux-pci@vger.kernel.org
Cc: bhelgaas@google.com, Gavin Shan <shangw@linux.vnet.ibm.com>
Subject: [PATCH 2/4] PCI: Remove MSI/MSI-X cap check in pci_msi_check_device()
Date: Fri,  5 Apr 2013 10:54:31 +0800	[thread overview]
Message-ID: <1365130473-7413-3-git-send-email-shangw@linux.vnet.ibm.com> (raw)
In-Reply-To: <1365130473-7413-1-git-send-email-shangw@linux.vnet.ibm.com>

The function pci_msi_check_device() is called while enabling MSI
or MSI-X interrupts to make sure the PCI device can support MSI
or MSI-X capability. The patch removes the check on MSI or MSI-X
capability in the function and lets the caller does the check.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
---
 drivers/pci/msi.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 5fdc5d9..1ec1ba9 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -789,9 +789,6 @@ static int pci_msi_check_device(struct pci_dev *dev, int nvec, int type)
 	if (ret)
 		return ret;
 
-	if (!pci_find_capability(dev, type))
-		return -EINVAL;
-
 	return 0;
 }
 
@@ -942,7 +939,7 @@ int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec)
 	int status, nr_entries;
 	int i, j;
 
-	if (!entries)
+	if (!entries || !dev->msix_cap)
 		return -EINVAL;
 
 	status = pci_msi_check_device(dev, nvec, PCI_CAP_ID_MSIX);
-- 
1.7.5.4


  parent reply	other threads:[~2013-04-05  2:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-05  2:54 [PATCH v3 0/5] Retrieve MSI/MSIX cap struct for once on setup Gavin Shan
2013-04-05  2:54 ` [PATCH 1/4] PCI: Cache MSI/MSI-X cap in PCI device Gavin Shan
2013-04-05  2:54 ` Gavin Shan [this message]
2013-04-05  2:54 ` [PATCH 3/4] PCI: Use cached MSI cap while enabling MSI interrupts Gavin Shan
2013-04-05  2:54 ` [PATCH 4/4] PCI: Use cached MSI-X cap while enabling MSI-X Gavin Shan
     [not found] ` <5167564e.c628320a.6610.1710SMTPIN_ADDED_BROKEN@mx.google.com>
2013-04-22 23:11   ` [PATCH v3 0/5] Retrieve MSI/MSIX cap struct for once on setup Bjorn Helgaas

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=1365130473-7413-3-git-send-email-shangw@linux.vnet.ibm.com \
    --to=shangw@linux.vnet.ibm.com \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@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).