diff options
author | Robert Richter <rrichter@amd.com> | 2023-06-22 23:55:11 +0300 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2023-06-25 22:22:53 +0300 |
commit | 5d2ffbe4b81a3b6353bf888a523e7e5d4fec47ad (patch) | |
tree | 536b1713da2cbbd90882e2d75a93de5cb97fda0c /drivers/cxl/core | |
parent | 19ab69a60e3ba58b4942b9ab5095cf90477a54ce (diff) | |
download | linux-5d2ffbe4b81a3b6353bf888a523e7e5d4fec47ad.tar.xz |
cxl/port: Store the downstream port's Component Register mappings in struct cxl_dport
Same as for ports, also store the downstream port's Component Register
mappings, use struct cxl_dport for that.
Signed-off-by: Robert Richter <rrichter@amd.com>
Signed-off-by: Terry Bowman <terry.bowman@amd.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20230622205523.85375-16-terry.bowman@amd.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/cxl/core')
-rw-r--r-- | drivers/cxl/core/port.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c index 43ffecebf1d8..cbd3d17f6410 100644 --- a/drivers/cxl/core/port.c +++ b/drivers/cxl/core/port.c @@ -711,6 +711,13 @@ static inline int cxl_port_setup_regs(struct cxl_port *port, component_reg_phys); } +static inline int cxl_dport_setup_regs(struct cxl_dport *dport, + resource_size_t component_reg_phys) +{ + return cxl_setup_comp_regs(dport->dport_dev, &dport->comp_map, + component_reg_phys); +} + static struct cxl_port *__devm_cxl_add_port(struct device *host, struct device *uport_dev, resource_size_t component_reg_phys, @@ -989,6 +996,10 @@ __devm_cxl_add_dport(struct cxl_port *port, struct device *dport_dev, dport->port_id = port_id; dport->port = port; + rc = cxl_dport_setup_regs(dport, component_reg_phys); + if (rc) + return ERR_PTR(rc); + cond_cxl_root_lock(port); rc = add_dport(port, dport); cond_cxl_root_unlock(port); |