Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: host: sl811: remove dentry pointer for debugfs

There is no need to keep the dentry pointer around for the created
debugfs file, as it is only needed when removing it from the system.
When it is to be removed, ask debugfs itself for the pointer, to save on
storage and make things a bit simpler.

Cc: linux-usb@vger.kernel.org
Link: https://lore.kernel.org/r/20210216144645.3813043-3-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+3 -5
+3 -4
drivers/usb/host/sl811-hcd.c
··· 1496 1496 /* expect just one sl811 per system */ 1497 1497 static void create_debug_file(struct sl811 *sl811) 1498 1498 { 1499 - sl811->debug_file = debugfs_create_file("sl811h", S_IRUGO, 1500 - usb_debug_root, sl811, 1501 - &sl811h_debug_fops); 1499 + debugfs_create_file("sl811h", S_IRUGO, usb_debug_root, sl811, 1500 + &sl811h_debug_fops); 1502 1501 } 1503 1502 1504 1503 static void remove_debug_file(struct sl811 *sl811) 1505 1504 { 1506 - debugfs_remove(sl811->debug_file); 1505 + debugfs_remove(debugfs_lookup("sl811h", usb_debug_root)); 1507 1506 } 1508 1507 1509 1508 /*-------------------------------------------------------------------------*/
-1
drivers/usb/host/sl811.h
··· 123 123 void __iomem *addr_reg; 124 124 void __iomem *data_reg; 125 125 struct sl811_platform_data *board; 126 - struct dentry *debug_file; 127 126 128 127 unsigned long stat_insrmv; 129 128 unsigned long stat_wake;