diff options
| author | Dave Jiang <dave.jiang@intel.com> | 2025-05-09 09:59:28 -0700 |
|---|---|---|
| committer | Dave Jiang <dave.jiang@intel.com> | 2025-05-09 09:59:28 -0700 |
| commit | 68d8b4f399e78a7be2bc69530c7e4b3e79fde9db (patch) | |
| tree | 088e0048b0625c12705e1cd51ddc9f957d04cb08 /drivers/cxl/core/port.c | |
| parent | cxl/test: Address missing MODULE_DESCRIPTION warnings for cxl_test (diff) | |
| parent | cxl: Add a dev_dbg() when a decoder was added to a port (diff) | |
| download | linux-68d8b4f399e78a7be2bc69530c7e4b3e79fde9db.tar.gz linux-68d8b4f399e78a7be2bc69530c7e4b3e79fde9db.zip | |
Merge branch 'for-6.16/cxl-cleanups' into cxl-for-next
In preparation for code changes related to AMD Zen5 address translation
support, a number of small code refactor and cleanups are send ahead.
Diffstat (limited to 'drivers/cxl/core/port.c')
| -rw-r--r-- | drivers/cxl/core/port.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c index 726bd4a7de27..eb46c6764d20 100644 --- a/drivers/cxl/core/port.c +++ b/drivers/cxl/core/port.c @@ -602,17 +602,19 @@ struct cxl_port *to_cxl_port(const struct device *dev) } EXPORT_SYMBOL_NS_GPL(to_cxl_port, "CXL"); +struct cxl_port *parent_port_of(struct cxl_port *port) +{ + if (!port || !port->parent_dport) + return NULL; + return port->parent_dport->port; +} + static void unregister_port(void *_port) { struct cxl_port *port = _port; - struct cxl_port *parent; + struct cxl_port *parent = parent_port_of(port); struct device *lock_dev; - if (is_cxl_root(port)) - parent = NULL; - else - parent = to_cxl_port(port->dev.parent); - /* * CXL root port's and the first level of ports are unregistered * under the platform firmware device lock, all other ports are @@ -1035,15 +1037,6 @@ struct cxl_root *find_cxl_root(struct cxl_port *port) } EXPORT_SYMBOL_NS_GPL(find_cxl_root, "CXL"); -void put_cxl_root(struct cxl_root *cxl_root) -{ - if (!cxl_root) - return; - - put_device(&cxl_root->port.dev); -} -EXPORT_SYMBOL_NS_GPL(put_cxl_root, "CXL"); - static struct cxl_dport *find_dport(struct cxl_port *port, int id) { struct cxl_dport *dport; |
