All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] USB: gadget: lpc32xx_udc: remove debugfs dentry variable
@ 2021-05-18 16:20 Greg Kroah-Hartman
  2021-05-19 11:09 ` Vladimir Zapolskiy
  2021-05-19 12:05 ` Felipe Balbi
  0 siblings, 2 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2021-05-18 16:20 UTC (permalink / raw)
  To: linux-usb; +Cc: Greg Kroah-Hartman, Felipe Balbi, Vladimir Zapolskiy

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/gadget/udc/lpc32xx_udc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/gadget/udc/lpc32xx_udc.c b/drivers/usb/gadget/udc/lpc32xx_udc.c
index 3f1c62adce4b..a25d01c89564 100644
--- a/drivers/usb/gadget/udc/lpc32xx_udc.c
+++ b/drivers/usb/gadget/udc/lpc32xx_udc.c
@@ -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
-- 
2.31.1


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

* Re: [PATCH] USB: gadget: lpc32xx_udc: remove debugfs dentry variable
  2021-05-18 16:20 [PATCH] USB: gadget: lpc32xx_udc: remove debugfs dentry variable Greg Kroah-Hartman
@ 2021-05-19 11:09 ` Vladimir Zapolskiy
  2021-05-21 11:45   ` Greg Kroah-Hartman
  2021-05-19 12:05 ` Felipe Balbi
  1 sibling, 1 reply; 5+ messages in thread
From: Vladimir Zapolskiy @ 2021-05-19 11:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-usb, Felipe Balbi

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

> Cc: Felipe Balbi <balbi@kernel.org>
> Cc: Vladimir Zapolskiy <vz@mleia.com>
> Cc: linux-usb@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Acked-by: Vladimir Zapolskiy <vz@mleia.com>

Thank you.

--
Best wishes,
Vladimir

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

* Re: [PATCH] USB: gadget: lpc32xx_udc: remove debugfs dentry variable
  2021-05-18 16:20 [PATCH] USB: gadget: lpc32xx_udc: remove debugfs dentry variable Greg Kroah-Hartman
  2021-05-19 11:09 ` Vladimir Zapolskiy
@ 2021-05-19 12:05 ` Felipe Balbi
  2021-05-21 11:45   ` Greg Kroah-Hartman
  1 sibling, 1 reply; 5+ messages in thread
From: Felipe Balbi @ 2021-05-19 12:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-usb; +Cc: Greg Kroah-Hartman, Vladimir Zapolskiy

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

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

> 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
> 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] 5+ messages in thread

* Re: [PATCH] USB: gadget: lpc32xx_udc: remove debugfs dentry variable
  2021-05-19 11:09 ` Vladimir Zapolskiy
@ 2021-05-21 11:45   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2021-05-21 11:45 UTC (permalink / raw)
  To: Vladimir Zapolskiy; +Cc: linux-usb, Felipe Balbi

On Wed, May 19, 2021 at 02:09:17PM +0300, Vladimir Zapolskiy wrote:
> On 5/18/21 7:20 PM, Greg Kroah-Hartman wrote:
> > 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.

Not a big deal :)

> > Cc: Felipe Balbi <balbi@kernel.org>
> > Cc: Vladimir Zapolskiy <vz@mleia.com>
> > Cc: linux-usb@vger.kernel.org
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> Acked-by: Vladimir Zapolskiy <vz@mleia.com>

Thanks for the review!

greg k-h

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

* Re: [PATCH] USB: gadget: lpc32xx_udc: remove debugfs dentry variable
  2021-05-19 12:05 ` Felipe Balbi
@ 2021-05-21 11:45   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2021-05-21 11:45 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: linux-usb, Vladimir Zapolskiy

On Wed, May 19, 2021 at 03:05:18PM +0300, Felipe Balbi wrote:
> Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:
> 
> > 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
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> Acked-by: Felipe Balbi <balbi@kernel.org>

Great, thanks for the review.

greg k-h

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

end of thread, other threads:[~2021-05-21 11:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 16:20 [PATCH] USB: gadget: lpc32xx_udc: remove debugfs dentry variable Greg Kroah-Hartman
2021-05-19 11:09 ` Vladimir Zapolskiy
2021-05-21 11:45   ` Greg Kroah-Hartman
2021-05-19 12:05 ` Felipe Balbi
2021-05-21 11:45   ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.