aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/uwb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/uwb')
-rw-r--r--drivers/uwb/pal.c5
-rw-r--r--drivers/uwb/uwb-debug.c13
-rw-r--r--drivers/uwb/uwb-internal.h3
3 files changed, 19 insertions, 2 deletions
diff --git a/drivers/uwb/pal.c b/drivers/uwb/pal.c
index 605765124f5b..99a19c199095 100644
--- a/drivers/uwb/pal.c
+++ b/drivers/uwb/pal.c
@@ -16,6 +16,7 @@
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */ 17 */
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/debugfs.h>
19#include <linux/uwb.h> 20#include <linux/uwb.h>
20 21
21#include "uwb-internal.h" 22#include "uwb-internal.h"
@@ -54,6 +55,8 @@ int uwb_pal_register(struct uwb_pal *pal)
54 } 55 }
55 } 56 }
56 57
58 pal->debugfs_dir = uwb_dbg_create_pal_dir(pal);
59
57 mutex_lock(&rc->uwb_dev.mutex); 60 mutex_lock(&rc->uwb_dev.mutex);
58 list_add(&pal->node, &rc->pals); 61 list_add(&pal->node, &rc->pals);
59 mutex_unlock(&rc->uwb_dev.mutex); 62 mutex_unlock(&rc->uwb_dev.mutex);
@@ -76,6 +79,8 @@ void uwb_pal_unregister(struct uwb_pal *pal)
76 list_del(&pal->node); 79 list_del(&pal->node);
77 mutex_unlock(&rc->uwb_dev.mutex); 80 mutex_unlock(&rc->uwb_dev.mutex);
78 81
82 debugfs_remove(pal->debugfs_dir);
83
79 if (pal->device) { 84 if (pal->device) {
80 sysfs_remove_link(&rc->uwb_dev.dev.kobj, pal->name); 85 sysfs_remove_link(&rc->uwb_dev.dev.kobj, pal->name);
81 sysfs_remove_link(&pal->device->kobj, "uwb_rc"); 86 sysfs_remove_link(&pal->device->kobj, "uwb_rc");
diff --git a/drivers/uwb/uwb-debug.c b/drivers/uwb/uwb-debug.c
index ec1b7a403ff3..a6debb9baf38 100644
--- a/drivers/uwb/uwb-debug.c
+++ b/drivers/uwb/uwb-debug.c
@@ -407,3 +407,16 @@ void uwb_dbg_exit(void)
407{ 407{
408 debugfs_remove(root_dir); 408 debugfs_remove(root_dir);
409} 409}
410
411/**
412 * uwb_dbg_create_pal_dir - create a debugfs directory for a PAL
413 * @pal: The PAL.
414 */
415struct dentry *uwb_dbg_create_pal_dir(struct uwb_pal *pal)
416{
417 struct uwb_rc *rc = pal->rc;
418
419 if (root_dir && rc->dbg && rc->dbg->root_d && pal->name)
420 return debugfs_create_dir(pal->name, rc->dbg->root_d);
421 return NULL;
422}
diff --git a/drivers/uwb/uwb-internal.h b/drivers/uwb/uwb-internal.h
index 9c0cdb4ded0c..f0f21f406bf0 100644
--- a/drivers/uwb/uwb-internal.h
+++ b/drivers/uwb/uwb-internal.h
@@ -284,8 +284,7 @@ void uwb_dbg_init(void);
284void uwb_dbg_exit(void); 284void uwb_dbg_exit(void);
285void uwb_dbg_add_rc(struct uwb_rc *rc); 285void uwb_dbg_add_rc(struct uwb_rc *rc);
286void uwb_dbg_del_rc(struct uwb_rc *rc); 286void uwb_dbg_del_rc(struct uwb_rc *rc);
287 287struct dentry *uwb_dbg_create_pal_dir(struct uwb_pal *pal);
288/* Workarounds for version specific stuff */
289 288
290static inline void uwb_dev_lock(struct uwb_dev *uwb_dev) 289static inline void uwb_dev_lock(struct uwb_dev *uwb_dev)
291{ 290{