All of
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <>
Cc: Greg Kroah-Hartman <>,
	Felipe Balbi <>,
	Vladimir Zapolskiy <>
Subject: [PATCH] USB: gadget: lpc32xx_udc: remove debugfs dentry variable
Date: Tue, 18 May 2021 18:20:35 +0200	[thread overview]
Message-ID: <> (raw)

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

Cc: Felipe Balbi <>
Cc: Vladimir Zapolskiy <>
Signed-off-by: Greg Kroah-Hartman <>
 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));

             reply	other threads:[~2021-05-18 16:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18 16:20 Greg Kroah-Hartman [this message]
2021-05-19 11:09 ` [PATCH] USB: gadget: lpc32xx_udc: remove debugfs dentry variable 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.