aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/cxl/test/mock.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2022-02-01 13:23:14 -0800
committerDan Williams <dan.j.williams@intel.com>2022-02-08 22:57:30 -0800
commit664bf115833c2d4ee717ab63f4e6e72a25c66e77 (patch)
tree89f244ae619e768a5ba400226bc66aed2d46e618 /tools/testing/cxl/test/mock.c
parentcxl/port: Add a driver for 'struct cxl_port' objects (diff)
downloadlinux-dev-664bf115833c2d4ee717ab63f4e6e72a25c66e77.tar.xz
linux-dev-664bf115833c2d4ee717ab63f4e6e72a25c66e77.zip
cxl/core/port: Remove @host argument for dport + decoder enumeration
Now that dport and decoder enumeration is centralized in the port driver, the @host argument for these helpers can be made implicit. For the root port the host is the port's uport device (ACPI0017 for cxl_acpi), and for all other descendant ports the devm context is the parent of @port. Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Ben Widawsky <ben.widawsky@intel.com> Link: https://lore.kernel.org/r/164375043390.484143.17617734732003230076.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'tools/testing/cxl/test/mock.c')
-rw-r--r--tools/testing/cxl/test/mock.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/tools/testing/cxl/test/mock.c b/tools/testing/cxl/test/mock.c
index 18d3b65e2a9b..6e8c9d63c92d 100644
--- a/tools/testing/cxl/test/mock.c
+++ b/tools/testing/cxl/test/mock.c
@@ -131,66 +131,62 @@ __wrap_nvdimm_bus_register(struct device *dev,
}
EXPORT_SYMBOL_GPL(__wrap_nvdimm_bus_register);
-struct cxl_hdm *__wrap_devm_cxl_setup_hdm(struct device *host,
- struct cxl_port *port)
+struct cxl_hdm *__wrap_devm_cxl_setup_hdm(struct cxl_port *port)
{
int index;
struct cxl_hdm *cxlhdm;
struct cxl_mock_ops *ops = get_cxl_mock_ops(&index);
if (ops && ops->is_mock_port(port->uport))
- cxlhdm = ops->devm_cxl_setup_hdm(host, port);
+ cxlhdm = ops->devm_cxl_setup_hdm(port);
else
- cxlhdm = devm_cxl_setup_hdm(host, port);
+ cxlhdm = devm_cxl_setup_hdm(port);
put_cxl_mock_ops(index);
return cxlhdm;
}
EXPORT_SYMBOL_NS_GPL(__wrap_devm_cxl_setup_hdm, CXL);
-int __wrap_devm_cxl_add_passthrough_decoder(struct device *host,
- struct cxl_port *port)
+int __wrap_devm_cxl_add_passthrough_decoder(struct cxl_port *port)
{
int rc, index;
struct cxl_mock_ops *ops = get_cxl_mock_ops(&index);
if (ops && ops->is_mock_port(port->uport))
- rc = ops->devm_cxl_add_passthrough_decoder(host, port);
+ rc = ops->devm_cxl_add_passthrough_decoder(port);
else
- rc = devm_cxl_add_passthrough_decoder(host, port);
+ rc = devm_cxl_add_passthrough_decoder(port);
put_cxl_mock_ops(index);
return rc;
}
EXPORT_SYMBOL_NS_GPL(__wrap_devm_cxl_add_passthrough_decoder, CXL);
-int __wrap_devm_cxl_enumerate_decoders(struct device *host,
- struct cxl_hdm *cxlhdm)
+int __wrap_devm_cxl_enumerate_decoders(struct cxl_hdm *cxlhdm)
{
int rc, index;
struct cxl_port *port = cxlhdm->port;
struct cxl_mock_ops *ops = get_cxl_mock_ops(&index);
if (ops && ops->is_mock_port(port->uport))
- rc = ops->devm_cxl_enumerate_decoders(host, cxlhdm);
+ rc = ops->devm_cxl_enumerate_decoders(cxlhdm);
else
- rc = devm_cxl_enumerate_decoders(host, cxlhdm);
+ rc = devm_cxl_enumerate_decoders(cxlhdm);
put_cxl_mock_ops(index);
return rc;
}
EXPORT_SYMBOL_NS_GPL(__wrap_devm_cxl_enumerate_decoders, CXL);
-int __wrap_devm_cxl_port_enumerate_dports(struct device *host,
- struct cxl_port *port)
+int __wrap_devm_cxl_port_enumerate_dports(struct cxl_port *port)
{
int rc, index;
struct cxl_mock_ops *ops = get_cxl_mock_ops(&index);
if (ops && ops->is_mock_port(port->uport))
- rc = ops->devm_cxl_port_enumerate_dports(host, port);
+ rc = ops->devm_cxl_port_enumerate_dports(port);
else
- rc = devm_cxl_port_enumerate_dports(host, port);
+ rc = devm_cxl_port_enumerate_dports(port);
put_cxl_mock_ops(index);
return rc;