···1616 * along with this program. If not, see <http://www.gnu.org/licenses/>.1717 */1818#include <linux/kernel.h>1919+#include <linux/debugfs.h>1920#include <linux/uwb.h>20212122#include "uwb-internal.h"···5554 }5655 }57565757+ pal->debugfs_dir = uwb_dbg_create_pal_dir(pal);5858+5859 mutex_lock(&rc->uwb_dev.mutex);5960 list_add(&pal->node, &rc->pals);6061 mutex_unlock(&rc->uwb_dev.mutex);···7875 mutex_lock(&rc->uwb_dev.mutex);7976 list_del(&pal->node);8077 mutex_unlock(&rc->uwb_dev.mutex);7878+7979+ debugfs_remove(pal->debugfs_dir);81808281 if (pal->device) {8382 sysfs_remove_link(&rc->uwb_dev.dev.kobj, pal->name);
+13
drivers/uwb/uwb-debug.c
···407407{408408 debugfs_remove(root_dir);409409}410410+411411+/**412412+ * uwb_dbg_create_pal_dir - create a debugfs directory for a PAL413413+ * @pal: The PAL.414414+ */415415+struct dentry *uwb_dbg_create_pal_dir(struct uwb_pal *pal)416416+{417417+ struct uwb_rc *rc = pal->rc;418418+419419+ if (root_dir && rc->dbg && rc->dbg->root_d && pal->name)420420+ return debugfs_create_dir(pal->name, rc->dbg->root_d);421421+ return NULL;422422+}
+1-2
drivers/uwb/uwb-internal.h
···284284void uwb_dbg_exit(void);285285void uwb_dbg_add_rc(struct uwb_rc *rc);286286void uwb_dbg_del_rc(struct uwb_rc *rc);287287-288288-/* Workarounds for version specific stuff */287287+struct dentry *uwb_dbg_create_pal_dir(struct uwb_pal *pal);289288290289static inline void uwb_dev_lock(struct uwb_dev *uwb_dev)291290{
+3
include/linux/uwb.h
···394394 * @channel: channel being used by the PAL; 0 if the PAL isn't using395395 * the radio; -1 if the PAL wishes to use the radio but396396 * cannot.397397+ * @debugfs_dir: a debugfs directory which the PAL can use for its own398398+ * debugfs files.397399 *398400 * A Protocol Adaptation Layer (PAL) is a user of the WiMedia UWB399401 * radio platform (e.g., WUSB, WLP or Bluetooth UWB AMP).···420418 void (*new_rsv)(struct uwb_pal *pal, struct uwb_rsv *rsv);421419422420 int channel;421421+ struct dentry *debugfs_dir;423422};424423425424void uwb_pal_init(struct uwb_pal *pal);