USB: gadget: lpc32xx_udc: remove debugfs dentry variable
Subsystems (2)
Greg Kroah-Hartman
maintainerPATCH 1/1 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...
--- drivers/usb/gadget/udc/lpc32xx_udc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/usb/gadget/udc/lpc32xx_udc.c +2 -3
@@ -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
Signature · 1 line
2.31.1
Quoted 8 lines · Greg Kroah-Hartman
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...
Yep, there is only one SoC with this device, and it has only one instance of this UDC. Bad excuse, I know it.
Quoted 4 lines
Cc Felipe Balbi <[email protected]>Cc Vladimir Zapolskiy <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Thank you.
--
Best wishes,
Vladimir
Greg Kroah-Hartman
maintainerQuoted 5 lines · Vladimir Zapolskiy
Quoted 4 lines · Greg Kroah-Hartman
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.
Quoted 7 lines
Quoted 4 lines
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...
Yep, there is only one SoC with this device, and it has only one instance of this UDC. Bad excuse, I know it.
Not a big deal :)
Quoted 6 lines
Quoted 4 lines
Cc Felipe Balbi <[email protected]>Cc Vladimir Zapolskiy <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Thanks for the review!
greg k-h
Quoted 9 lines · Greg Kroah-Hartman
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...
Quoted 4 lines
Cc Felipe Balbi <[email protected]>Cc Vladimir Zapolskiy <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Signature · 1 line
balbi
Greg Kroah-Hartman
maintainerQuoted 11 lines · Felipe Balbi
Quoted 9 lines · Greg Kroah-Hartman
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...
Quoted 6 lines
Quoted 4 lines
Cc Felipe Balbi <[email protected]>Cc Vladimir Zapolskiy <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>Acked-by Felipe Balbi <[email protected]>
Great, thanks for the review.
greg k-h