summaryrefslogtreecommitdiffstats
path: root/drivers/cxl/core/port.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2022-07-10 18:57:28 +0200
committerDan Williams <dan.j.williams@intel.com>2022-07-10 18:57:28 +0200
commit9b99ecf5a316f056d7139fa76198c8a2297846d1 (patch)
tree7050b2df414c457a868e42c0ebedb414ffff7f2e /drivers/cxl/core/port.c
parentcxl/Documentation: List attribute permissions (diff)
downloadlinux-9b99ecf5a316f056d7139fa76198c8a2297846d1.tar.xz
linux-9b99ecf5a316f056d7139fa76198c8a2297846d1.zip
cxl/debug: Move debugfs init to cxl_core_init()
In preparation for a new cxl debugfs file, move 'cxl' directory establishment and teardown to the core and let subsequent init routines reference that setup. Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/165603884654.551046.4962104601691723080.stgit@dwillia2-xfh Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/cxl/core/port.c')
-rw-r--r--drivers/cxl/core/port.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c
index 9b2df1353c2c..eecebd66416d 100644
--- a/drivers/cxl/core/port.c
+++ b/drivers/cxl/core/port.c
@@ -2,6 +2,7 @@
/* Copyright(c) 2020 Intel Corporation. All rights reserved. */
#include <linux/io-64-nonatomic-lo-hi.h>
#include <linux/workqueue.h>
+#include <linux/debugfs.h>
#include <linux/device.h>
#include <linux/module.h>
#include <linux/pci.h>
@@ -1499,10 +1500,19 @@ struct bus_type cxl_bus_type = {
};
EXPORT_SYMBOL_NS_GPL(cxl_bus_type, CXL);
+static struct dentry *cxl_debugfs;
+
+struct dentry *cxl_debugfs_create_dir(const char *dir)
+{
+ return debugfs_create_dir(dir, cxl_debugfs);
+}
+
static __init int cxl_core_init(void)
{
int rc;
+ cxl_debugfs = debugfs_create_dir("cxl", NULL);
+
cxl_mbox_init();
rc = cxl_memdev_init();
@@ -1525,7 +1535,6 @@ err_bus:
destroy_workqueue(cxl_bus_wq);
err_wq:
cxl_memdev_exit();
- cxl_mbox_exit();
return rc;
}
@@ -1534,7 +1543,7 @@ static void cxl_core_exit(void)
bus_unregister(&cxl_bus_type);
destroy_workqueue(cxl_bus_wq);
cxl_memdev_exit();
- cxl_mbox_exit();
+ debugfs_remove_recursive(cxl_debugfs);
}
module_init(cxl_core_init);