diff options
Diffstat (limited to 'drivers/bluetooth/btmrvl_debugfs.c')
-rw-r--r-- | drivers/bluetooth/btmrvl_debugfs.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/bluetooth/btmrvl_debugfs.c b/drivers/bluetooth/btmrvl_debugfs.c index 4617bd12f63b..b50b41d97a7f 100644 --- a/drivers/bluetooth/btmrvl_debugfs.c +++ b/drivers/bluetooth/btmrvl_debugfs.c | |||
@@ -19,6 +19,7 @@ | |||
19 | **/ | 19 | **/ |
20 | 20 | ||
21 | #include <linux/debugfs.h> | 21 | #include <linux/debugfs.h> |
22 | #include <linux/slab.h> | ||
22 | 23 | ||
23 | #include <net/bluetooth/bluetooth.h> | 24 | #include <net/bluetooth/bluetooth.h> |
24 | #include <net/bluetooth/hci_core.h> | 25 | #include <net/bluetooth/hci_core.h> |
@@ -26,10 +27,10 @@ | |||
26 | #include "btmrvl_drv.h" | 27 | #include "btmrvl_drv.h" |
27 | 28 | ||
28 | struct btmrvl_debugfs_data { | 29 | struct btmrvl_debugfs_data { |
29 | struct dentry *root_dir, *config_dir, *status_dir; | 30 | struct dentry *config_dir; |
31 | struct dentry *status_dir; | ||
30 | 32 | ||
31 | /* config */ | 33 | /* config */ |
32 | struct dentry *drvdbg; | ||
33 | struct dentry *psmode; | 34 | struct dentry *psmode; |
34 | struct dentry *pscmd; | 35 | struct dentry *pscmd; |
35 | struct dentry *hsmode; | 36 | struct dentry *hsmode; |
@@ -364,6 +365,9 @@ void btmrvl_debugfs_init(struct hci_dev *hdev) | |||
364 | struct btmrvl_private *priv = hdev->driver_data; | 365 | struct btmrvl_private *priv = hdev->driver_data; |
365 | struct btmrvl_debugfs_data *dbg; | 366 | struct btmrvl_debugfs_data *dbg; |
366 | 367 | ||
368 | if (!hdev->debugfs) | ||
369 | return; | ||
370 | |||
367 | dbg = kzalloc(sizeof(*dbg), GFP_KERNEL); | 371 | dbg = kzalloc(sizeof(*dbg), GFP_KERNEL); |
368 | priv->debugfs_data = dbg; | 372 | priv->debugfs_data = dbg; |
369 | 373 | ||
@@ -372,9 +376,7 @@ void btmrvl_debugfs_init(struct hci_dev *hdev) | |||
372 | return; | 376 | return; |
373 | } | 377 | } |
374 | 378 | ||
375 | dbg->root_dir = debugfs_create_dir("btmrvl", NULL); | 379 | dbg->config_dir = debugfs_create_dir("config", hdev->debugfs); |
376 | |||
377 | dbg->config_dir = debugfs_create_dir("config", dbg->root_dir); | ||
378 | 380 | ||
379 | dbg->psmode = debugfs_create_file("psmode", 0644, dbg->config_dir, | 381 | dbg->psmode = debugfs_create_file("psmode", 0644, dbg->config_dir, |
380 | hdev->driver_data, &btmrvl_psmode_fops); | 382 | hdev->driver_data, &btmrvl_psmode_fops); |
@@ -389,7 +391,7 @@ void btmrvl_debugfs_init(struct hci_dev *hdev) | |||
389 | dbg->hscfgcmd = debugfs_create_file("hscfgcmd", 0644, dbg->config_dir, | 391 | dbg->hscfgcmd = debugfs_create_file("hscfgcmd", 0644, dbg->config_dir, |
390 | hdev->driver_data, &btmrvl_hscfgcmd_fops); | 392 | hdev->driver_data, &btmrvl_hscfgcmd_fops); |
391 | 393 | ||
392 | dbg->status_dir = debugfs_create_dir("status", dbg->root_dir); | 394 | dbg->status_dir = debugfs_create_dir("status", hdev->debugfs); |
393 | dbg->curpsmode = debugfs_create_file("curpsmode", 0444, | 395 | dbg->curpsmode = debugfs_create_file("curpsmode", 0444, |
394 | dbg->status_dir, | 396 | dbg->status_dir, |
395 | hdev->driver_data, | 397 | hdev->driver_data, |
@@ -426,7 +428,5 @@ void btmrvl_debugfs_remove(struct hci_dev *hdev) | |||
426 | debugfs_remove(dbg->txdnldready); | 428 | debugfs_remove(dbg->txdnldready); |
427 | debugfs_remove(dbg->status_dir); | 429 | debugfs_remove(dbg->status_dir); |
428 | 430 | ||
429 | debugfs_remove(dbg->root_dir); | ||
430 | |||
431 | kfree(dbg); | 431 | kfree(dbg); |
432 | } | 432 | } |