diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c index f6ced15dbf73..252aa3dc96e2 100644 --- a/drivers/cxl/core/port.c +++ b/drivers/cxl/core/port.c @@ -694,15 +694,17 @@ static struct cxl_port *cxl_port_alloc(struct device *uport_dev, static int cxl_setup_comp_regs(struct device *host, struct cxl_register_map *map, resource_size_t component_reg_phys) { + *map = (struct cxl_register_map) { + .host = host, + .reg_type = CXL_REGLOC_RBI_EMPTY, + .resource = component_reg_phys, + }; + if (component_reg_phys == CXL_RESOURCE_NONE) return 0; - *map = (struct cxl_register_map) { - .host = host, - .reg_type = CXL_REGLOC_RBI_COMPONENT, - .resource = component_reg_phys, - .max_size = CXL_COMPONENT_REG_BLOCK_SIZE, - }; + map->reg_type = CXL_REGLOC_RBI_COMPONENT; + map->max_size = CXL_COMPONENT_REG_BLOCK_SIZE; return cxl_setup_regs(map); }