summaryrefslogtreecommitdiff
path: root/drivers/cxl/mem.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2021-05-14 08:21:49 +0300
committerDan Williams <dan.j.williams@intel.com>2021-05-15 02:13:18 +0300
commit5f50d6b20ca31d91de14cc09be3e5ce67bc99e04 (patch)
treef169101a8b04a7e7c94ba67ec274f2dcee841bed /drivers/cxl/mem.c
parent6efb943b8616ec53a5e444193dccf1af9ad627b5 (diff)
downloadlinux-5f50d6b20ca31d91de14cc09be3e5ce67bc99e04.tar.xz
cxl/mem: Move some definitions to mem.h
In preparation for sharing cxl.h with other generic CXL consumers, move / consolidate some of the memory device specifics to mem.h. The motivation for moving out of cxl.h is to maintain least privilege access to memory-device details since cxl.h is used in multiple files. The motivation for moving definitions into a new mem.h header is for code readability and organization. I.e. minimize implementation details when reading data structures and other definitions. Reviewed-by: Ben Widawsky <ben.widawsky@intel.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/162096970932.1865304.14510894426562947262.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/cxl/mem.c')
-rw-r--r--drivers/cxl/mem.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/drivers/cxl/mem.c b/drivers/cxl/mem.c
index 2acc6173da36..53933d7d8d12 100644
--- a/drivers/cxl/mem.c
+++ b/drivers/cxl/mem.c
@@ -13,6 +13,7 @@
#include <linux/io-64-nonatomic-lo-hi.h>
#include "pci.h"
#include "cxl.h"
+#include "mem.h"
/**
* DOC: cxl mem
@@ -30,12 +31,6 @@
* - Handle and manage error conditions.
*/
-/*
- * An entire PCI topology full of devices should be enough for any
- * config
- */
-#define CXL_MEM_MAX_DEVS 65536
-
#define cxl_doorbell_busy(cxlm) \
(readl((cxlm)->mbox_regs + CXLDEV_MBOX_CTRL_OFFSET) & \
CXLDEV_MBOX_CTRL_DOORBELL)
@@ -92,20 +87,6 @@ struct mbox_cmd {
#define CXL_MBOX_SUCCESS 0
};
-/**
- * struct cxl_memdev - CXL bus object representing a Type-3 Memory Device
- * @dev: driver core device object
- * @cdev: char dev core object for ioctl operations
- * @cxlm: pointer to the parent device driver data
- * @id: id number of this memdev instance.
- */
-struct cxl_memdev {
- struct device dev;
- struct cdev cdev;
- struct cxl_mem *cxlm;
- int id;
-};
-
static int cxl_mem_major;
static DEFINE_IDA(cxl_memdev_ida);
static DECLARE_RWSEM(cxl_memdev_rwsem);