USB: gadget: pxa27x_udc: remove dentry storage for debugfs file

There is no need to store the dentry pointer for a debugfs file that we
only use to remove it when the device goes away.  debugfs can do the
lookup for us instead, saving us some trouble, and making things smaller
overall.

Cc: Daniel Mack <daniel@zonque.org>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Felipe Balbi <balbi@kernel.org>
Link: https://lore.kernel.org/r/20210525171636.758758-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Greg Kroah-Hartman 2021-05-25 19:16:36 +02:00
Родитель 0cac357717
Коммит 8efd88f946
2 изменённых файлов: 1 добавлений и 7 удалений

Просмотреть файл

@ -208,8 +208,6 @@ static void pxa_init_debugfs(struct pxa_udc *udc)
struct dentry *root; struct dentry *root;
root = debugfs_create_dir(udc->gadget.name, usb_debug_root); root = debugfs_create_dir(udc->gadget.name, usb_debug_root);
udc->debugfs_root = root;
debugfs_create_file("udcstate", 0400, root, udc, &state_dbg_fops); debugfs_create_file("udcstate", 0400, root, udc, &state_dbg_fops);
debugfs_create_file("queues", 0400, root, udc, &queues_dbg_fops); debugfs_create_file("queues", 0400, root, udc, &queues_dbg_fops);
debugfs_create_file("epstate", 0400, root, udc, &eps_dbg_fops); debugfs_create_file("epstate", 0400, root, udc, &eps_dbg_fops);
@ -217,7 +215,7 @@ static void pxa_init_debugfs(struct pxa_udc *udc)
static void pxa_cleanup_debugfs(struct pxa_udc *udc) static void pxa_cleanup_debugfs(struct pxa_udc *udc)
{ {
debugfs_remove_recursive(udc->debugfs_root); debugfs_remove(debugfs_lookup(udc->gadget.name, usb_debug_root));
} }
#else #else

Просмотреть файл

@ -440,7 +440,6 @@ struct udc_stats {
* @last_interface: UDC interface of the last SET_INTERFACE host request * @last_interface: UDC interface of the last SET_INTERFACE host request
* @last_alternate: UDC altsetting of the last SET_INTERFACE host request * @last_alternate: UDC altsetting of the last SET_INTERFACE host request
* @udccsr0: save of udccsr0 in case of suspend * @udccsr0: save of udccsr0 in case of suspend
* @debugfs_root: root entry of debug filesystem
* @debugfs_state: debugfs entry for "udcstate" * @debugfs_state: debugfs entry for "udcstate"
* @debugfs_queues: debugfs entry for "queues" * @debugfs_queues: debugfs entry for "queues"
* @debugfs_eps: debugfs entry for "epstate" * @debugfs_eps: debugfs entry for "epstate"
@ -474,9 +473,6 @@ struct pxa_udc {
#ifdef CONFIG_PM #ifdef CONFIG_PM
unsigned udccsr0; unsigned udccsr0;
#endif #endif
#ifdef CONFIG_USB_GADGET_DEBUG_FS
struct dentry *debugfs_root;
#endif
}; };
#define to_pxa(g) (container_of((g), struct pxa_udc, gadget)) #define to_pxa(g) (container_of((g), struct pxa_udc, gadget))