@@ -446,7 +446,10 @@ struct cxl_port *devm_cxl_add_port(struct device *host, struct device *uport,
dev = &port->dev;
if (parent_port)
- rc = dev_set_name(dev, "port%d", port->id);
+ if (is_cxl_memdev(uport))
+ rc = dev_set_name(dev, "devport%d", port->id);
+ else
+ rc = dev_set_name(dev, "port%d", port->id);
else
rc = dev_set_name(dev, "root%d", port->id);
if (rc)
@@ -24,7 +24,7 @@ static int port_match(struct device *dev, const void *data)
port = to_cxl_port(dev);
- if (find_dport_by_dev(port, data))
+ if (find_dport_by_dev(port, (struct device *)data))
return 1;
return 0;
@@ -37,7 +37,7 @@ static int cxl_memdev_probe(struct device *dev)
struct pci_dev *pdev = cxlm->pdev;
struct device *pdev_parent = cxlm->pdev->dev.parent;
struct device *port_dev;
- int pcie_dvsec;
+ int pcie_dvsec, rc;
u16 dvsec_ctrl;
port_dev = bus_find_device(&cxl_bus_type, NULL, pdev_parent, port_match);
@@ -58,7 +58,13 @@ static int cxl_memdev_probe(struct device *dev)
return -ENODEV;
}
- return 0;
+ rc = PTR_ERR_OR_ZERO(devm_cxl_add_port(&cxlmd->dev, &cxlmd->dev,
+ CXL_RESOURCE_NONE,
+ to_cxl_port(port_dev)));
+ if (rc)
+ dev_err(dev, "Unable to add devices upstream port");
+
+ return rc;
}
static void cxl_memdev_remove(struct device *dev)
Signed-off-by: Ben Widawsky <ben.widawsky@intel.com> --- drivers/cxl/core/bus.c | 5 ++++- drivers/cxl/mem.c | 12 +++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-)