USB: gadget: pxa25x_udc: remove dentry storage for debugfs file
Subsystems (2)
Greg Kroah-Hartman
maintainerPATCH 1/1 USB: gadget: pxa25x_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.
--- drivers/usb/gadget/udc/pxa25x_udc.c | 4 ++-- drivers/usb/gadget/udc/pxa25x_udc.h | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-)
drivers/usb/gadget/udc/pxa25x_udc.c +2 -2
@@ -1338,10 +1338,10 @@ DEFINE_SHOW_ATTRIBUTE(udc_debug);#define create_debug_files (dev) \ do { \ - dev->debugfs_udc = debugfs_create_file(dev->gadget.name, \ + debugfs_create_file(dev->gadget.name, \ S_IRUGO, NULL, dev, &udc_debug_fops); \ } while (0) -#define remove_debug_files (dev) debugfs_remove(dev->debugfs_udc) +#define remove_debug_files (dev) debugfs_remove(debugfs_lookup(dev->gadget.name, NULL))#else /* !CONFIG_USB_GADGET_DEBUG_FILES */
drivers/usb/gadget/udc/pxa25x_udc.h +0 -4
@@ -116,10 +116,6 @@ struct pxa25x_udc {struct usb_phy *transceiver;u64 dma_mask;struct pxa25x_ep ep [PXA_UDC_NUM_ENDPOINTS ]; - -#ifdef CONFIG_USB_GADGET_DEBUG_FS -struct dentry *debugfs_udc; -#endif void __iomem *regs; };#define to_pxa25x (g) (container_of((g), struct pxa25x_udc, gadget))
Signature · 1 line
2.31.1
Quoted 6 lines · Greg Kroah-Hartman
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 <[email protected]>
Greg, can you take this via your tree?
Thanks,
Daniel
Quoted 43 lines
Cc Haojian Zhuang <[email protected]>Cc Robert Jarzmik <[email protected]>Cc Felipe Balbi <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/usb/gadget/udc/pxa25x_udc.c | 4 ++-- drivers/usb/gadget/udc/pxa25x_udc.h | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-)drivers/usb/gadget/udc/pxa25x_udc.c +2
-2@@ -1338,10 +1338,10 @@ DEFINE_SHOW_ATTRIBUTE(udc_debug);#define create_debug_files (dev) \ do { \ - dev->debugfs_udc = debugfs_create_file(dev->gadget.name, \ + debugfs_create_file(dev->gadget.name, \ S_IRUGO, NULL, dev, &udc_debug_fops); \ } while (0) -#define remove_debug_files (dev) debugfs_remove(dev->debugfs_udc) +#define remove_debug_files (dev) debugfs_remove(debugfs_lookup(dev->gadget.name, NULL))#else /* !CONFIG_USB_GADGET_DEBUG_FILES */ drivers/usb/gadget/udc/pxa25x_udc.h +0
-4@@ -116,10 +116,6 @@ struct pxa25x_udc {struct usb_phy *transceiver;u64 dma_mask;struct pxa25x_ep ep [PXA_UDC_NUM_ENDPOINTS ]; - -#ifdef CONFIG_USB_GADGET_DEBUG_FS -struct dentry *debugfs_udc; -#endif void __iomem *regs; };#define to_pxa25x (g) (container_of((g), struct pxa25x_udc, gadget))
Greg Kroah-Hartman
maintainerQuoted 6 lines · Daniel Mack
Quoted 5 lines · Greg Kroah-Hartman
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.
Quoted 6 lines
Quoted 1 line
Cc Daniel Mack <[email protected]>Acked-by Daniel Mack <[email protected]>Greg, can you take this via your tree?
Yes I can :)
thanks for the review,
greg k-h
Quoted 11 lines · Greg Kroah-Hartman
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 <[email protected]>Cc Haojian Zhuang <[email protected]>Cc Robert Jarzmik <[email protected]>Cc Felipe Balbi <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Signature · 1 line
balbi