提交 0cac3577 编写于 作者: G Greg Kroah-Hartman

USB: gadget: bcm63xx_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: Kevin Cernekee <cernekee@gmail.com>
Cc: Felipe Balbi <balbi@kernel.org>
Cc: bcm-kernel-feedback-list@broadcom.com
Link: https://lore.kernel.org/r/20210525171508.758365-1-gregkh@linuxfoundation.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 8f6c7c5a
...@@ -288,7 +288,6 @@ struct bcm63xx_req { ...@@ -288,7 +288,6 @@ struct bcm63xx_req {
* @ep0_req_completed: ep0 request has completed; worker has not seen it yet. * @ep0_req_completed: ep0 request has completed; worker has not seen it yet.
* @ep0_reply: Pending reply from gadget driver. * @ep0_reply: Pending reply from gadget driver.
* @ep0_request: Outstanding ep0 request. * @ep0_request: Outstanding ep0 request.
* @debugfs_root: debugfs directory: /sys/kernel/debug/<DRV_MODULE_NAME>.
*/ */
struct bcm63xx_udc { struct bcm63xx_udc {
spinlock_t lock; spinlock_t lock;
...@@ -327,8 +326,6 @@ struct bcm63xx_udc { ...@@ -327,8 +326,6 @@ struct bcm63xx_udc {
unsigned ep0_req_completed:1; unsigned ep0_req_completed:1;
struct usb_request *ep0_reply; struct usb_request *ep0_reply;
struct usb_request *ep0_request; struct usb_request *ep0_request;
struct dentry *debugfs_root;
}; };
static const struct usb_ep_ops bcm63xx_udc_ep_ops; static const struct usb_ep_ops bcm63xx_udc_ep_ops;
...@@ -2250,8 +2247,6 @@ static void bcm63xx_udc_init_debugfs(struct bcm63xx_udc *udc) ...@@ -2250,8 +2247,6 @@ static void bcm63xx_udc_init_debugfs(struct bcm63xx_udc *udc)
return; return;
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("usbd", 0400, root, udc, &bcm63xx_usbd_dbg_fops); debugfs_create_file("usbd", 0400, root, udc, &bcm63xx_usbd_dbg_fops);
debugfs_create_file("iudma", 0400, root, udc, &bcm63xx_iudma_dbg_fops); debugfs_create_file("iudma", 0400, root, udc, &bcm63xx_iudma_dbg_fops);
} }
...@@ -2264,7 +2259,7 @@ static void bcm63xx_udc_init_debugfs(struct bcm63xx_udc *udc) ...@@ -2264,7 +2259,7 @@ static void bcm63xx_udc_init_debugfs(struct bcm63xx_udc *udc)
*/ */
static void bcm63xx_udc_cleanup_debugfs(struct bcm63xx_udc *udc) static void bcm63xx_udc_cleanup_debugfs(struct bcm63xx_udc *udc)
{ {
debugfs_remove_recursive(udc->debugfs_root); debugfs_remove(debugfs_lookup(udc->gadget.name, usb_debug_root));
} }
/*********************************************************************** /***********************************************************************
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册