summaryrefslogtreecommitdiff
path: root/drivers/cxl/cxl.h
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2024-01-05 15:07:40 -0700
committerDan Williams <dan.j.williams@intel.com>2024-01-05 14:36:29 -0800
commit44cd71ef7bacdfcf7c3e8a7b13f11a7eba69533d (patch)
treec7d195c0a28201dc4be971746a848115a95c58d0 /drivers/cxl/cxl.h
parent98856b2ea3065d8f60e90f423d7707f4a4706ec5 (diff)
cxl: Convert find_cxl_root() to return a 'struct cxl_root *'
Commit 790815902ec6 ("cxl: Add support for _DSM Function for retrieving QTG ID") introduced 'struct cxl_root', however all usages have been worked indirectly through cxl_port. Refactor code such as find_cxl_root() function to use 'struct cxl_root' directly. Suggested-by: Dan Williams <dan.j.williams@intel.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Dave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/170449246044.3779673.13035770941393418591.stgit@djiang5-mobl3 Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/cxl/cxl.h')
-rw-r--r--drivers/cxl/cxl.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/cxl/cxl.h b/drivers/cxl/cxl.h
index df3db3e43913..3a5004aab97a 100644
--- a/drivers/cxl/cxl.h
+++ b/drivers/cxl/cxl.h
@@ -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)
{
@@ -734,7 +734,7 @@ struct cxl_port *devm_cxl_add_port(struct device *host,
struct cxl_dport *parent_dport);
struct cxl_root *devm_cxl_add_root(struct device *host,
const struct cxl_root_ops *ops);
-struct cxl_port *find_cxl_root(struct cxl_port *port);
+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))