@@ -295,14 +295,12 @@ cxl_acpi_evaluate_qtg_dsm(acpi_handle handle, struct access_coordinate *coord,
return rc;
}
-static int cxl_acpi_qos_class(struct cxl_port *root_port,
+static int cxl_acpi_qos_class(struct cxl_root *cxl_root,
struct access_coordinate *coord, int entries,
int *qos_class)
{
+ struct device *dev = cxl_root->port.uport_dev;
acpi_handle handle;
- struct device *dev;
-
- dev = root_port->uport_dev;
if (!dev_is_platform(dev))
return -ENODEV;
@@ -191,7 +191,7 @@ static int cxl_port_perf_data_calculate(struct cxl_port *port,
dent->coord.write_bandwidth);
dent->entries = 1;
- rc = cxl_root->ops->qos_class(&cxl_root->port, &dent->coord, 1,
+ rc = cxl_root->ops->qos_class(cxl_root, &dent->coord, 1,
&qos_class);
if (rc != 1)
continue;
@@ -617,12 +617,6 @@ struct cxl_port {
long pci_latency;
};
-struct cxl_root_ops {
- int (*qos_class)(struct cxl_port *root_port,
- struct access_coordinate *coord, int entries,
- int *qos_class);
-};
-
/**
* struct cxl_root - logical collection of root cxl_port items
*
@@ -640,6 +634,12 @@ to_cxl_root(const struct cxl_port *port)
return container_of(port, struct cxl_root, port);
}
+struct cxl_root_ops {
+ int (*qos_class)(struct cxl_root *cxl_root,
+ struct access_coordinate *coord, int entries,
+ int *qos_class);
+};
+
static inline struct cxl_dport *
cxl_find_dport_by_dev(struct cxl_port *port, const struct device *dport_dev)
{
->qos_class() is expected to take a 'struct cxl_root *' instead of a 'struct cxl_port *'. Convert to directly accepting a 'struct cxl_root *' to ensure that the root port device is passed in. Signed-off-by: Dave Jiang <dave.jiang@intel.com> --- drivers/cxl/acpi.c | 6 ++---- drivers/cxl/core/cdat.c | 2 +- drivers/cxl/cxl.h | 12 ++++++------ 3 files changed, 9 insertions(+), 11 deletions(-)