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

USB: host: isp1362: 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-2-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+3 -6
+3 -5
drivers/usb/host/isp1362-hcd.c
··· 2164 2164 /* expect just one isp1362_hcd per system */ 2165 2165 static void create_debug_file(struct isp1362_hcd *isp1362_hcd) 2166 2166 { 2167 - isp1362_hcd->debug_file = debugfs_create_file("isp1362", S_IRUGO, 2168 - usb_debug_root, 2169 - isp1362_hcd, 2170 - &isp1362_fops); 2167 + debugfs_create_file("isp1362", S_IRUGO, usb_debug_root, isp1362_hcd, 2168 + &isp1362_fops); 2171 2169 } 2172 2170 2173 2171 static void remove_debug_file(struct isp1362_hcd *isp1362_hcd) 2174 2172 { 2175 - debugfs_remove(isp1362_hcd->debug_file); 2173 + debugfs_remove(debugfs_lookup("isp1362", usb_debug_root)); 2176 2174 } 2177 2175 2178 2176 /*-------------------------------------------------------------------------*/
-1
drivers/usb/host/isp1362.h
··· 435 435 436 436 struct isp1362_platform_data *board; 437 437 438 - struct dentry *debug_file; 439 438 unsigned long stat1, stat2, stat4, stat8, stat16; 440 439 441 440 /* HC registers */