summaryrefslogtreecommitdiff
path: root/drivers/ntb/ntb_hw.h
diff options
context:
space:
mode:
authorJon Mason <jon.mason@intel.com>2013-07-31 02:58:49 +0400
committerJon Mason <jon.mason@intel.com>2013-09-03 22:14:54 +0400
commit1517a3f21a1dd321f16bcf44204bddff9d21abd0 (patch)
tree45b8eb39ea33fae5f66af89376f5029e45d09127 /drivers/ntb/ntb_hw.h
parentb6750cfe0710a14fd147ba27fddbecae8ba88c77 (diff)
downloadlinux-1517a3f21a1dd321f16bcf44204bddff9d21abd0.tar.xz
NTB: Correct debugfs to work with more than 1 NTB Device
Debugfs was setup in NTB to only have a single debugfs directory. This resulted in the leaking of debugfs directories and files when multiple NTB devices were present, due to each device stomping on the variables containing the previous device's values (thus preventing them from being freed on cleanup). Correct this by creating a secondary directory of the PCI BDF for each device present, and nesting the previously existing information in those directories. Signed-off-by: Jon Mason <jon.mason@intel.com>
Diffstat (limited to 'drivers/ntb/ntb_hw.h')
-rw-r--r--drivers/ntb/ntb_hw.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/ntb/ntb_hw.h b/drivers/ntb/ntb_hw.h
index 3a3038ca83e6..6a4f56f564ee 100644
--- a/drivers/ntb/ntb_hw.h
+++ b/drivers/ntb/ntb_hw.h
@@ -127,6 +127,8 @@ struct ntb_device {
unsigned char link_status;
struct delayed_work hb_timer;
unsigned long last_ts;
+
+ struct dentry *debugfs_dir;
};
/**
@@ -155,6 +157,20 @@ static inline struct pci_dev *ntb_query_pdev(struct ntb_device *ndev)
return ndev->pdev;
}
+/**
+ * ntb_query_debugfs() - return the debugfs pointer
+ * @ndev: pointer to ntb_device instance
+ *
+ * Given the ntb pointer, return the debugfs directory pointer for the NTB
+ * hardware device
+ *
+ * RETURNS: a pointer to the debugfs directory
+ */
+static inline struct dentry *ntb_query_debugfs(struct ntb_device *ndev)
+{
+ return ndev->debugfs_dir;
+}
+
struct ntb_device *ntb_register_transport(struct pci_dev *pdev,
void *transport);
void ntb_unregister_transport(struct ntb_device *ndev);