Commit 74bf125a authored by Robert Richter's avatar Robert Richter Committed by Dave Jiang
Browse files

cxl/port: Replace put_cxl_root() by a cleanup helper



Function put_cxl_root() is only used by its cleanup helper. Remove the
function entirely and only use the helper.

Signed-off-by: default avatarRobert Richter <rrichter@amd.com>
Reviewed-by: default avatarGregory Price <gourry@gourry.net>
Reviewed-by: default avatarDave Jiang <dave.jiang@intel.com>
Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: default avatar"Fabio M. De Francesco" <fabio.m.de.francesco@linux.intel.com>
Acked-by: default avatarDan Williams <dan.j.williams@intel.com>
Link: https://patch.msgid.link/20250509150700.2817697-9-rrichter@amd.com


Signed-off-by: default avatarDave Jiang <dave.jiang@intel.com>
parent 5ed826fc
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -1037,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;
+2 −2
Original line number Diff line number Diff line
@@ -737,10 +737,10 @@ struct cxl_port *devm_cxl_add_port(struct device *host,
struct cxl_root *devm_cxl_add_root(struct device *host,
				   const struct cxl_root_ops *ops);
struct cxl_root *find_cxl_root(struct cxl_port *port);
void put_cxl_root(struct cxl_root *cxl_root);
DEFINE_FREE(put_cxl_root, struct cxl_root *, if (_T) put_cxl_root(_T))

DEFINE_FREE(put_cxl_root, struct cxl_root *, if (_T) put_device(&_T->port.dev))
DEFINE_FREE(put_cxl_port, struct cxl_port *, if (!IS_ERR_OR_NULL(_T)) put_device(&_T->dev))

int devm_cxl_enumerate_ports(struct cxl_memdev *cxlmd);
void cxl_bus_rescan(void);
void cxl_bus_drain(void);