Skip to content

Commit 74bf125

Browse files
Robert Richterdavejiang
authored andcommitted
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: Robert Richter <[email protected]> Reviewed-by: Gregory Price <[email protected]> Reviewed-by: Dave Jiang <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Reviewed-by: "Fabio M. De Francesco" <[email protected]> Acked-by: Dan Williams <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Dave Jiang <[email protected]>
1 parent 5ed826f commit 74bf125

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

drivers/cxl/core/port.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,15 +1037,6 @@ struct cxl_root *find_cxl_root(struct cxl_port *port)
10371037
}
10381038
EXPORT_SYMBOL_NS_GPL(find_cxl_root, "CXL");
10391039

1040-
void put_cxl_root(struct cxl_root *cxl_root)
1041-
{
1042-
if (!cxl_root)
1043-
return;
1044-
1045-
put_device(&cxl_root->port.dev);
1046-
}
1047-
EXPORT_SYMBOL_NS_GPL(put_cxl_root, "CXL");
1048-
10491040
static struct cxl_dport *find_dport(struct cxl_port *port, int id)
10501041
{
10511042
struct cxl_dport *dport;

drivers/cxl/cxl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,10 +737,10 @@ struct cxl_port *devm_cxl_add_port(struct device *host,
737737
struct cxl_root *devm_cxl_add_root(struct device *host,
738738
const struct cxl_root_ops *ops);
739739
struct cxl_root *find_cxl_root(struct cxl_port *port);
740-
void put_cxl_root(struct cxl_root *cxl_root);
741-
DEFINE_FREE(put_cxl_root, struct cxl_root *, if (_T) put_cxl_root(_T))
742740

741+
DEFINE_FREE(put_cxl_root, struct cxl_root *, if (_T) put_device(&_T->port.dev))
743742
DEFINE_FREE(put_cxl_port, struct cxl_port *, if (!IS_ERR_OR_NULL(_T)) put_device(&_T->dev))
743+
744744
int devm_cxl_enumerate_ports(struct cxl_memdev *cxlmd);
745745
void cxl_bus_rescan(void);
746746
void cxl_bus_drain(void);

0 commit comments

Comments
 (0)