aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/misc/cxl/pci.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
index b66d832d3233..c79ba1c699ad 100644
--- a/drivers/misc/cxl/pci.c
+++ b/drivers/misc/cxl/pci.c
@@ -1718,7 +1718,6 @@ int cxl_slot_is_switched(struct pci_dev *dev)
1718{ 1718{
1719 struct device_node *np; 1719 struct device_node *np;
1720 int depth = 0; 1720 int depth = 0;
1721 const __be32 *prop;
1722 1721
1723 if (!(np = pci_device_to_OF_node(dev))) { 1722 if (!(np = pci_device_to_OF_node(dev))) {
1724 pr_err("cxl: np = NULL\n"); 1723 pr_err("cxl: np = NULL\n");
@@ -1727,8 +1726,7 @@ int cxl_slot_is_switched(struct pci_dev *dev)
1727 of_node_get(np); 1726 of_node_get(np);
1728 while (np) { 1727 while (np) {
1729 np = of_get_next_parent(np); 1728 np = of_get_next_parent(np);
1730 prop = of_get_property(np, "device_type", NULL); 1729 if (!of_node_is_type(np, "pciex"))
1731 if (!prop || strcmp((char *)prop, "pciex"))
1732 break; 1730 break;
1733 depth++; 1731 depth++;
1734 } 1732 }