summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/cxl/acpi.c5
-rw-r--r--drivers/cxl/core/port.c9
2 files changed, 8 insertions, 6 deletions
diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c
index 0b267eabb15e..4e8086525edc 100644
--- a/drivers/cxl/acpi.c
+++ b/drivers/cxl/acpi.c
@@ -264,11 +264,6 @@ static int add_host_bridge_uport(struct device *match, void *arg)
if (IS_ERR(cxld))
return PTR_ERR(cxld);
- cxld->interleave_ways = 1;
- cxld->interleave_granularity = PAGE_SIZE;
- cxld->target_type = CXL_DECODER_EXPANDER;
- cxld->platform_res = (struct resource)DEFINE_RES_MEM(0, 0);
-
device_lock(&port->dev);
dport = list_first_entry(&port->dports, typeof(*dport), list);
device_unlock(&port->dev);
diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c
index 88ffec71464a..73ff42a05473 100644
--- a/drivers/cxl/core/port.c
+++ b/drivers/cxl/core/port.c
@@ -505,7 +505,8 @@ out_unlock:
* some address space for CXL.mem utilization. A decoder is expected to be
* configured by the caller before registering.
*
- * Return: A new cxl decoder to be registered by cxl_decoder_add()
+ * Return: A new cxl decoder to be registered by cxl_decoder_add(). The decoder
+ * is initialized to be a "passthrough" decoder.
*/
static struct cxl_decoder *cxl_decoder_alloc(struct cxl_port *port,
unsigned int nr_targets)
@@ -537,6 +538,12 @@ static struct cxl_decoder *cxl_decoder_alloc(struct cxl_port *port,
else
cxld->dev.type = &cxl_decoder_switch_type;
+ /* Pre initialize an "empty" decoder */
+ cxld->interleave_ways = 1;
+ cxld->interleave_granularity = PAGE_SIZE;
+ cxld->target_type = CXL_DECODER_EXPANDER;
+ cxld->platform_res = (struct resource)DEFINE_RES_MEM(0, 0);
+
return cxld;
err:
kfree(cxld);