Commit b914a250e7b390c713b36a9405a39c4c11abad80
1 parent
ca325f6989
Exists in
master
and in
7 other branches
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: Marcel Holtmann <marcel@holtmann.org>
Showing 1 changed file with 7 additions and 7 deletions Side-by-side Diff
drivers/bluetooth/btmrvl_debugfs.c
... | ... | @@ -26,7 +26,8 @@ |
26 | 26 | #include "btmrvl_drv.h" |
27 | 27 | |
28 | 28 | struct btmrvl_debugfs_data { |
29 | - struct dentry *root_dir, *config_dir, *status_dir; | |
29 | + struct dentry *config_dir; | |
30 | + struct dentry *status_dir; | |
30 | 31 | |
31 | 32 | /* config */ |
32 | 33 | struct dentry *psmode; |
... | ... | @@ -363,6 +364,9 @@ |
363 | 364 | struct btmrvl_private *priv = hdev->driver_data; |
364 | 365 | struct btmrvl_debugfs_data *dbg; |
365 | 366 | |
367 | + if (!hdev->debugfs) | |
368 | + return; | |
369 | + | |
366 | 370 | dbg = kzalloc(sizeof(*dbg), GFP_KERNEL); |
367 | 371 | priv->debugfs_data = dbg; |
368 | 372 | |
369 | 373 | |
... | ... | @@ -371,10 +375,8 @@ |
371 | 375 | return; |
372 | 376 | } |
373 | 377 | |
374 | - dbg->root_dir = debugfs_create_dir("btmrvl", NULL); | |
378 | + dbg->config_dir = debugfs_create_dir("config", hdev->debugfs); | |
375 | 379 | |
376 | - dbg->config_dir = debugfs_create_dir("config", dbg->root_dir); | |
377 | - | |
378 | 380 | dbg->psmode = debugfs_create_file("psmode", 0644, dbg->config_dir, |
379 | 381 | hdev->driver_data, &btmrvl_psmode_fops); |
380 | 382 | dbg->pscmd = debugfs_create_file("pscmd", 0644, dbg->config_dir, |
... | ... | @@ -388,7 +390,7 @@ |
388 | 390 | dbg->hscfgcmd = debugfs_create_file("hscfgcmd", 0644, dbg->config_dir, |
389 | 391 | hdev->driver_data, &btmrvl_hscfgcmd_fops); |
390 | 392 | |
391 | - dbg->status_dir = debugfs_create_dir("status", dbg->root_dir); | |
393 | + dbg->status_dir = debugfs_create_dir("status", hdev->debugfs); | |
392 | 394 | dbg->curpsmode = debugfs_create_file("curpsmode", 0444, |
393 | 395 | dbg->status_dir, |
394 | 396 | hdev->driver_data, |
... | ... | @@ -424,8 +426,6 @@ |
424 | 426 | debugfs_remove(dbg->hsstate); |
425 | 427 | debugfs_remove(dbg->txdnldready); |
426 | 428 | debugfs_remove(dbg->status_dir); |
427 | - | |
428 | - debugfs_remove(dbg->root_dir); | |
429 | 429 | |
430 | 430 | kfree(dbg); |
431 | 431 | } |