IB/qib: Use pci_is_root_bus() to check whether it is a root bus
authorYijing Wang <wangyijing@huawei.com>
Mon, 9 Sep 2013 13:13:05 +0000 (21:13 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 24 Sep 2013 18:13:03 +0000 (12:13 -0600)
Use pci_is_root_bus() instead of "if (bus->parent)" statement
for better readability.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
drivers/infiniband/hw/qib/qib_pcie.c

index 3f14009fb6625bb90f3adb94bbf72cd782d61e4f..45e55ff33dbf274c2345107a74e6c45443e119e2 100644 (file)
@@ -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;
        }