mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 00:00:00 -04:00
USB: dwc3: remove debugfs root dentry storage
There is no need to keep around the debugfs "root" directory for the dwc3 device. Instead, look it up anytime we need to find it. This will help when callers get out-of-order and we had the potential to have a "stale" pointer around for the root dentry, as has happened in the past. Change-Id: I7fd1973704cd2a9e193fd77e01f7e09236f41117 Tested-by: Jack Pham <jackp@codeaurora.org> Reviewed-by: Peter Chen <peter.chen@kernel.org> Acked-by: Felipe Balbi <balbi@kernel.org> Link: https://lore.kernel.org/r/20210609093924.3293230-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Git-commit: 8562d5bfc0fcdfd3aef32991e17dca585ae5ae7d Git-Repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git [quic_ppratap@quicinc.com: resolved trivial merge conflicts] Signed-off-by: Pratham Pratap <quic_ppratap@quicinc.com>
This commit is contained in:
parent
97db20de99
commit
63b8a425d9
3 changed files with 7 additions and 7 deletions
|
|
@ -1081,7 +1081,6 @@ struct dwc3_scratchpad_array {
|
|||
* @link_state: link state
|
||||
* @speed: device speed (super, high, full, low)
|
||||
* @hwparams: copy of hwparams registers
|
||||
* @root: debugfs root folder pointer
|
||||
* @regset: debugfs pointer to regdump file
|
||||
* @dbg_lsp_select: current debug lsp mux register selection
|
||||
* @test_mode: true when we're entering a USB test mode
|
||||
|
|
@ -1307,7 +1306,6 @@ struct dwc3 {
|
|||
u8 num_eps;
|
||||
|
||||
struct dwc3_hwparams hwparams;
|
||||
struct dentry *root;
|
||||
struct debugfs_regset32 *regset;
|
||||
|
||||
u32 dbg_lsp_select;
|
||||
|
|
|
|||
|
|
@ -1023,8 +1023,10 @@ static void dwc3_debugfs_create_endpoint_files(struct dwc3_ep *dep,
|
|||
void dwc3_debugfs_create_endpoint_dir(struct dwc3_ep *dep)
|
||||
{
|
||||
struct dentry *dir;
|
||||
struct dentry *root;
|
||||
|
||||
dir = debugfs_create_dir(dep->name, dep->dwc->root);
|
||||
root = debugfs_lookup(dev_name(dep->dwc->dev), usb_debug_root);
|
||||
dir = debugfs_create_dir(dep->name, root);
|
||||
if (!dir) {
|
||||
pr_err("%s: failed to create dir %s\n", __func__, dep->name);
|
||||
return;
|
||||
|
|
@ -1278,8 +1280,6 @@ void dwc3_debugfs_init(struct dwc3 *dwc)
|
|||
return;
|
||||
}
|
||||
|
||||
dwc->root = root;
|
||||
|
||||
debugfs_create_file("regdump", 0444, root, dwc, &dwc3_regdump_fops);
|
||||
|
||||
debugfs_create_file("lsp_dump", S_IRUGO | S_IWUSR, root, dwc,
|
||||
|
|
@ -1310,6 +1310,6 @@ void dwc3_debugfs_init(struct dwc3 *dwc)
|
|||
|
||||
void dwc3_debugfs_exit(struct dwc3 *dwc)
|
||||
{
|
||||
debugfs_remove_recursive(dwc->root);
|
||||
debugfs_remove(debugfs_lookup(dev_name(dwc->dev), usb_debug_root));
|
||||
kfree(dwc->regset);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3144,7 +3144,9 @@ static void dwc3_gadget_free_endpoints(struct dwc3 *dwc)
|
|||
list_del(&dep->endpoint.ep_list);
|
||||
}
|
||||
|
||||
debugfs_remove_recursive(debugfs_lookup(dep->name, dwc->root));
|
||||
debugfs_remove_recursive(debugfs_lookup(dep->name,
|
||||
debugfs_lookup(dev_name(dep->dwc->dev),
|
||||
usb_debug_root)));
|
||||
kfree(dep);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue