linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] USB: gadget: pxa25x_udc: remove dentry storage for debugfs file
@ 2021-05-18 16:20 Greg Kroah-Hartman
  2021-05-18 16:23 ` Daniel Mack
  2021-06-03  6:16 ` Felipe Balbi
  0 siblings, 2 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2021-05-18 16:20 UTC (permalink / raw)
  To: linux-usb
  Cc: Greg Kroah-Hartman, Daniel Mack, Haojian Zhuang, Robert Jarzmik,
	Felipe Balbi

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 <daniel@zonque.org>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Felipe Balbi <balbi@kernel.org>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/gadget/udc/pxa25x_udc.c | 4 ++--
 drivers/usb/gadget/udc/pxa25x_udc.h | 4 ----
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/gadget/udc/pxa25x_udc.c b/drivers/usb/gadget/udc/pxa25x_udc.c
index 10324a7334fe..69ef1e669d0c 100644
--- a/drivers/usb/gadget/udc/pxa25x_udc.c
+++ b/drivers/usb/gadget/udc/pxa25x_udc.c
@@ -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 */
 
diff --git a/drivers/usb/gadget/udc/pxa25x_udc.h b/drivers/usb/gadget/udc/pxa25x_udc.h
index ccc6b921f067..aa4b68fd9fc0 100644
--- a/drivers/usb/gadget/udc/pxa25x_udc.h
+++ b/drivers/usb/gadget/udc/pxa25x_udc.h
@@ -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))
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] USB: gadget: pxa25x_udc: remove dentry storage for debugfs file
  2021-05-18 16:20 [PATCH] USB: gadget: pxa25x_udc: remove dentry storage for debugfs file Greg Kroah-Hartman
@ 2021-05-18 16:23 ` Daniel Mack
  2021-05-18 16:29   ` Greg Kroah-Hartman
  2021-06-03  6:16 ` Felipe Balbi
  1 sibling, 1 reply; 4+ messages in thread
From: Daniel Mack @ 2021-05-18 16:23 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-usb
  Cc: Haojian Zhuang, Robert Jarzmik, Felipe Balbi

On 5/18/21 6:20 PM, Greg Kroah-Hartman wrote:
> 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 <daniel@zonque.org>

Acked-by: Daniel Mack <daniel@zonque.org>


Greg, can you take this via your tree?


Thanks,
Daniel



> Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
> Cc: Robert Jarzmik <robert.jarzmik@free.fr>
> Cc: Felipe Balbi <balbi@kernel.org>
> Cc: linux-usb@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  drivers/usb/gadget/udc/pxa25x_udc.c | 4 ++--
>  drivers/usb/gadget/udc/pxa25x_udc.h | 4 ----
>  2 files changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/usb/gadget/udc/pxa25x_udc.c b/drivers/usb/gadget/udc/pxa25x_udc.c
> index 10324a7334fe..69ef1e669d0c 100644
> --- a/drivers/usb/gadget/udc/pxa25x_udc.c
> +++ b/drivers/usb/gadget/udc/pxa25x_udc.c
> @@ -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 */
>  
> diff --git a/drivers/usb/gadget/udc/pxa25x_udc.h b/drivers/usb/gadget/udc/pxa25x_udc.h
> index ccc6b921f067..aa4b68fd9fc0 100644
> --- a/drivers/usb/gadget/udc/pxa25x_udc.h
> +++ b/drivers/usb/gadget/udc/pxa25x_udc.h
> @@ -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))
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] USB: gadget: pxa25x_udc: remove dentry storage for debugfs file
  2021-05-18 16:23 ` Daniel Mack
@ 2021-05-18 16:29   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2021-05-18 16:29 UTC (permalink / raw)
  To: Daniel Mack; +Cc: linux-usb, Haojian Zhuang, Robert Jarzmik, Felipe Balbi

On Tue, May 18, 2021 at 06:23:33PM +0200, Daniel Mack wrote:
> On 5/18/21 6:20 PM, Greg Kroah-Hartman wrote:
> > 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 <daniel@zonque.org>
> 
> Acked-by: Daniel Mack <daniel@zonque.org>
> 
> 
> Greg, can you take this via your tree?

Yes I can :)

thanks for the review,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] USB: gadget: pxa25x_udc: remove dentry storage for debugfs file
  2021-05-18 16:20 [PATCH] USB: gadget: pxa25x_udc: remove dentry storage for debugfs file Greg Kroah-Hartman
  2021-05-18 16:23 ` Daniel Mack
@ 2021-06-03  6:16 ` Felipe Balbi
  1 sibling, 0 replies; 4+ messages in thread
From: Felipe Balbi @ 2021-06-03  6:16 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-usb
  Cc: Greg Kroah-Hartman, Daniel Mack, Haojian Zhuang, Robert Jarzmik

[-- Attachment #1: Type: text/plain, Size: 629 bytes --]

Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:

> 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 <daniel@zonque.org>
> Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
> Cc: Robert Jarzmik <robert.jarzmik@free.fr>
> Cc: Felipe Balbi <balbi@kernel.org>
> Cc: linux-usb@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Acked-by: Felipe Balbi <balbi@kernel.org>

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-03  6:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 16:20 [PATCH] USB: gadget: pxa25x_udc: remove dentry storage for debugfs file Greg Kroah-Hartman
2021-05-18 16:23 ` Daniel Mack
2021-05-18 16:29   ` Greg Kroah-Hartman
2021-06-03  6:16 ` Felipe Balbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).