USB: gadget: lpc32xx_udc: remove debugfs dentry variable
There is no need to store the dentry for a fixed filename that we have the string for. So just have debugfs look it up when we need it to remove the file, no need to store it anywhere locally. Note, this driver is broken in that debugfs will not work for more than one instance of the device it supports. But given that this patch does not change that, and no one has ever seemed to notice, it must not be an issue... Cc: Felipe Balbi <balbi@kernel.org> Cc: Vladimir Zapolskiy <vz@mleia.com> Cc: linux-usb@vger.kernel.org Acked-by: Vladimir Zapolskiy <vz@mleia.com> Acked-by: Felipe Balbi <balbi@kernel.org> Link: https://lore.kernel.org/r/20210518162035.3697860-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
92c6dc0beb
commit
e3d59eff47
|
@ -127,7 +127,6 @@ struct lpc32xx_udc {
|
|||
struct usb_gadget_driver *driver;
|
||||
struct platform_device *pdev;
|
||||
struct device *dev;
|
||||
struct dentry *pde;
|
||||
spinlock_t lock;
|
||||
struct i2c_client *isp1301_i2c_client;
|
||||
|
||||
|
@ -528,12 +527,12 @@ DEFINE_SHOW_ATTRIBUTE(udc);
|
|||
|
||||
static void create_debug_file(struct lpc32xx_udc *udc)
|
||||
{
|
||||
udc->pde = debugfs_create_file(debug_filename, 0, NULL, udc, &udc_fops);
|
||||
debugfs_create_file(debug_filename, 0, NULL, udc, &udc_fops);
|
||||
}
|
||||
|
||||
static void remove_debug_file(struct lpc32xx_udc *udc)
|
||||
{
|
||||
debugfs_remove(udc->pde);
|
||||
debugfs_remove(debugfs_lookup(debug_filename, NULL));
|
||||
}
|
||||
|
||||
#else
|
||||
|
|
Loading…
Reference in New Issue