summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/device/pciexp_device.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/device/pciexp_device.c b/src/device/pciexp_device.c
index 449315bb29..c8ac391c06 100644
--- a/src/device/pciexp_device.c
+++ b/src/device/pciexp_device.c
@@ -211,8 +211,7 @@ static bool _pciexp_enable_ltr(struct device *parent, unsigned int parent_cap,
return true;
if (parent &&
- (parent->path.type != DEVICE_PATH_PCI ||
- !_pciexp_ltr_supported(parent, parent_cap) ||
+ (!_pciexp_ltr_supported(parent, parent_cap) ||
!_pciexp_ltr_enabled(parent, parent_cap)))
return false;
@@ -235,6 +234,8 @@ static void pciexp_enable_ltr(struct device *dev)
unsigned int parent_cap = 0;
if (!dev->ops->ops_pci || !dev->ops->ops_pci->get_ltr_max_latencies) {
parent = dev->bus->dev;
+ if (parent->path.type != DEVICE_PATH_PCI)
+ return;
parent_cap = pci_find_capability(parent, PCI_CAP_ID_PCIE);
if (!parent_cap)
return;