Patchwork [3/6] IB/qib: Use pci_is_root_bus() to check whether it is a root bus

login
register
mail settings
Submitter Yijing Wang
Date Sept. 9, 2013, 1:13 p.m.
Message ID <1378732388-4508-4-git-send-email-wangyijing@huawei.com>
Download mbox | patch
Permalink /patch/273568/
State Accepted
Headers show

Comments

Yijing Wang - Sept. 9, 2013, 1:13 p.m.
Use pci_is_root_bus() instead of "if (bus->parent)" statement
for better readability.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 drivers/infiniband/hw/qib/qib_pcie.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Marciniszyn, Mike - Sept. 9, 2013, 2:51 p.m.
> Subject: [PATCH 3/6] IB/qib: Use pci_is_root_bus() to check whether it is a root
> bus
> 

Thanks for the patch!

Acked-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/infiniband/hw/qib/qib_pcie.c b/drivers/infiniband/hw/qib/qib_pcie.c
index c574ec7..3a5b99b 100644
--- a/drivers/infiniband/hw/qib/qib_pcie.c
+++ b/drivers/infiniband/hw/qib/qib_pcie.c
@@ -590,7 +590,7 @@  static int qib_tune_pcie_caps(struct qib_devdata *dd)
 
 	/* Find out supported and configured values for parent (root) */
 	parent = dd->pcidev->bus->self;
-	if (parent->bus->parent) {
+	if (!pci_is_root_bus(parent->bus)) {
 		qib_devinfo(dd->pcidev, "Parent not root\n");
 		goto bail;
 	}