diff mbox series

[RFC,3/4] cxl: Move cxl_memdev conversion helper to mem.h

Message ID 20210610185725.897541-4-ben.widawsky@intel.com
State New, archived
Headers show
Series Region Creation | expand

Commit Message

Ben Widawsky June 10, 2021, 6:57 p.m. UTC
Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
---
 drivers/cxl/mem.h | 5 +++++
 drivers/cxl/pci.c | 5 -----
 2 files changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/drivers/cxl/mem.h b/drivers/cxl/mem.h
index 4c4eb06a966b..9795aa924035 100644
--- a/drivers/cxl/mem.h
+++ b/drivers/cxl/mem.h
@@ -48,6 +48,11 @@  struct cxl_memdev {
 	int id;
 };
 
+static inline struct cxl_memdev *to_cxl_memdev(struct device *dev)
+{
+       return container_of(dev, struct cxl_memdev, dev);
+}
+
 /**
  * struct cxl_region - CXL region
  * @dev: This region's device.
diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c
index 5a1705b52278..be158f8f995e 100644
--- a/drivers/cxl/pci.c
+++ b/drivers/cxl/pci.c
@@ -1142,11 +1142,6 @@  static int cxl_mem_setup_regs(struct cxl_mem *cxlm)
 	return ret;
 }
 
-static struct cxl_memdev *to_cxl_memdev(struct device *dev)
-{
-	return container_of(dev, struct cxl_memdev, dev);
-}
-
 static void cxl_memdev_release(struct device *dev)
 {
 	struct cxl_memdev *cxlmd = to_cxl_memdev(dev);