Commit b914a250 authored by Marcel Holtmann's avatar Marcel Holtmann

Bluetooth: Convert Marvell driver to use per adapter debugfs

The debugfs support of the Marvell driver is buggy. It is limited to one
controller per system. Fix this by using the controller specific debugfs
directory as parent.
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent ca325f69
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
#include "btmrvl_drv.h" #include "btmrvl_drv.h"
struct btmrvl_debugfs_data { struct btmrvl_debugfs_data {
struct dentry *root_dir, *config_dir, *status_dir; struct dentry *config_dir;
struct dentry *status_dir;
/* config */ /* config */
struct dentry *psmode; struct dentry *psmode;
...@@ -363,6 +364,9 @@ void btmrvl_debugfs_init(struct hci_dev *hdev) ...@@ -363,6 +364,9 @@ void btmrvl_debugfs_init(struct hci_dev *hdev)
struct btmrvl_private *priv = hdev->driver_data; struct btmrvl_private *priv = hdev->driver_data;
struct btmrvl_debugfs_data *dbg; struct btmrvl_debugfs_data *dbg;
if (!hdev->debugfs)
return;
dbg = kzalloc(sizeof(*dbg), GFP_KERNEL); dbg = kzalloc(sizeof(*dbg), GFP_KERNEL);
priv->debugfs_data = dbg; priv->debugfs_data = dbg;
...@@ -371,9 +375,7 @@ void btmrvl_debugfs_init(struct hci_dev *hdev) ...@@ -371,9 +375,7 @@ void btmrvl_debugfs_init(struct hci_dev *hdev)
return; return;
} }
dbg->root_dir = debugfs_create_dir("btmrvl", NULL); dbg->config_dir = debugfs_create_dir("config", hdev->debugfs);
dbg->config_dir = debugfs_create_dir("config", dbg->root_dir);
dbg->psmode = debugfs_create_file("psmode", 0644, dbg->config_dir, dbg->psmode = debugfs_create_file("psmode", 0644, dbg->config_dir,
hdev->driver_data, &btmrvl_psmode_fops); hdev->driver_data, &btmrvl_psmode_fops);
...@@ -388,7 +390,7 @@ void btmrvl_debugfs_init(struct hci_dev *hdev) ...@@ -388,7 +390,7 @@ void btmrvl_debugfs_init(struct hci_dev *hdev)
dbg->hscfgcmd = debugfs_create_file("hscfgcmd", 0644, dbg->config_dir, dbg->hscfgcmd = debugfs_create_file("hscfgcmd", 0644, dbg->config_dir,
hdev->driver_data, &btmrvl_hscfgcmd_fops); hdev->driver_data, &btmrvl_hscfgcmd_fops);
dbg->status_dir = debugfs_create_dir("status", dbg->root_dir); dbg->status_dir = debugfs_create_dir("status", hdev->debugfs);
dbg->curpsmode = debugfs_create_file("curpsmode", 0444, dbg->curpsmode = debugfs_create_file("curpsmode", 0444,
dbg->status_dir, dbg->status_dir,
hdev->driver_data, hdev->driver_data,
...@@ -425,7 +427,5 @@ void btmrvl_debugfs_remove(struct hci_dev *hdev) ...@@ -425,7 +427,5 @@ void btmrvl_debugfs_remove(struct hci_dev *hdev)
debugfs_remove(dbg->txdnldready); debugfs_remove(dbg->txdnldready);
debugfs_remove(dbg->status_dir); debugfs_remove(dbg->status_dir);
debugfs_remove(dbg->root_dir);
kfree(dbg); kfree(dbg);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment