mutex_init(&mds->mbox_mutex);
        mutex_init(&mds->event.log_lock);
        mds->cxlds.dev = dev;
+       mds->cxlds.reg_map.host = dev;
+       mds->cxlds.reg_map.resource = CXL_RESOURCE_NONE;
        mds->cxlds.type = CXL_DEVTYPE_CLASSMEM;
 
        return mds;
 
  *
  * @dev: The device associated with this CXL state
  * @cxlmd: The device representing the CXL.mem capabilities of @dev
+ * @reg_map: component and ras register mapping parameters
  * @regs: Parsed register blocks
  * @cxl_dvsec: Offset to the PCIe device DVSEC
  * @rcd: operating in RCD mode (CXL 3.0 9.11.8 CXL Devices Attached to an RCH)
 struct cxl_dev_state {
        struct device *dev;
        struct cxl_memdev *cxlmd;
+       struct cxl_register_map reg_map;
        struct cxl_regs regs;
        int cxl_dvsec;
        bool rcd;
 
         * still be useful for management functions so don't return an error.
         */
        cxlds->component_reg_phys = CXL_RESOURCE_NONE;
-       rc = cxl_pci_setup_regs(pdev, CXL_REGLOC_RBI_COMPONENT, &map);
+       rc = cxl_pci_setup_regs(pdev, CXL_REGLOC_RBI_COMPONENT,
+                               &cxlds->reg_map);
        if (rc)
                dev_warn(&pdev->dev, "No component registers (%d)\n", rc);
-       else if (!map.component_map.ras.valid)
+       else if (!cxlds->reg_map.component_map.ras.valid)
                dev_dbg(&pdev->dev, "RAS registers not found\n");
 
-       cxlds->component_reg_phys = map.resource;
+       cxlds->component_reg_phys = cxlds->reg_map.resource;
 
-       rc = cxl_map_component_regs(&map, &cxlds->regs.component,
+       rc = cxl_map_component_regs(&cxlds->reg_map, &cxlds->regs.component,
                                    BIT(CXL_CM_CAP_CAP_ID_RAS));
        if (rc)
                dev_dbg(&pdev->dev, "Failed to map RAS capability.\n");