All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] USB: host: isp116x: remove dentry pointer for debugfs
@ 2021-02-16 14:46 Greg Kroah-Hartman
  2021-02-16 14:46 ` [PATCH 2/6] USB: host: isp1362: " Greg Kroah-Hartman
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-16 14:46 UTC (permalink / raw)
  To: linux-usb; +Cc: Greg Kroah-Hartman, Olav Kongas

There is no need to keep the dentry pointer around for the created
debugfs file, as it is only needed when removing it from the system.
When it is to be removed, ask debugfs itself for the pointer, to save on
storage and make things a bit simpler.

Cc: Olav Kongas <ok@artecdesign.ee>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/host/isp116x-hcd.c | 7 +++----
 drivers/usb/host/isp116x.h     | 1 -
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c
index 8544a2a2c1e6..8835f6bd528e 100644
--- a/drivers/usb/host/isp116x-hcd.c
+++ b/drivers/usb/host/isp116x-hcd.c
@@ -1200,14 +1200,13 @@ DEFINE_SHOW_ATTRIBUTE(isp116x_debug);
 
 static void create_debug_file(struct isp116x *isp116x)
 {
-	isp116x->dentry = debugfs_create_file(hcd_name,
-					      S_IRUGO, NULL, isp116x,
-					      &isp116x_debug_fops);
+	debugfs_create_file(hcd_name, S_IRUGO, usb_debug_root, isp116x,
+			    &isp116x_debug_fops);
 }
 
 static void remove_debug_file(struct isp116x *isp116x)
 {
-	debugfs_remove(isp116x->dentry);
+	debugfs_remove(debugfs_lookup(hcd_name, usb_debug_root));
 }
 
 #else
diff --git a/drivers/usb/host/isp116x.h b/drivers/usb/host/isp116x.h
index a5e929c10d53..84904025fe7f 100644
--- a/drivers/usb/host/isp116x.h
+++ b/drivers/usb/host/isp116x.h
@@ -260,7 +260,6 @@ struct isp116x {
 
 	struct isp116x_platform_data *board;
 
-	struct dentry *dentry;
 	unsigned long stat1, stat2, stat4, stat8, stat16;
 
 	/* HC registers */
-- 
2.30.1


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

* [PATCH 2/6] USB: host: isp1362: remove dentry pointer for debugfs
  2021-02-16 14:46 [PATCH 1/6] USB: host: isp116x: remove dentry pointer for debugfs Greg Kroah-Hartman
@ 2021-02-16 14:46 ` Greg Kroah-Hartman
  2021-02-16 14:46 ` [PATCH 3/6] USB: host: sl811: " Greg Kroah-Hartman
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-16 14:46 UTC (permalink / raw)
  To: linux-usb; +Cc: Greg Kroah-Hartman

There is no need to keep the dentry pointer around for the created
debugfs file, as it is only needed when removing it from the system.
When it is to be removed, ask debugfs itself for the pointer, to save on
storage and make things a bit simpler.

Cc: linux-usb@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/host/isp1362-hcd.c | 8 +++-----
 drivers/usb/host/isp1362.h     | 1 -
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/host/isp1362-hcd.c b/drivers/usb/host/isp1362-hcd.c
index 2cecb36d241b..d8610ce8f2ec 100644
--- a/drivers/usb/host/isp1362-hcd.c
+++ b/drivers/usb/host/isp1362-hcd.c
@@ -2164,15 +2164,13 @@ DEFINE_SHOW_ATTRIBUTE(isp1362);
 /* expect just one isp1362_hcd per system */
 static void create_debug_file(struct isp1362_hcd *isp1362_hcd)
 {
-	isp1362_hcd->debug_file = debugfs_create_file("isp1362", S_IRUGO,
-						      usb_debug_root,
-						      isp1362_hcd,
-						      &isp1362_fops);
+	debugfs_create_file("isp1362", S_IRUGO, usb_debug_root, isp1362_hcd,
+			    &isp1362_fops);
 }
 
 static void remove_debug_file(struct isp1362_hcd *isp1362_hcd)
 {
-	debugfs_remove(isp1362_hcd->debug_file);
+	debugfs_remove(debugfs_lookup("isp1362", usb_debug_root));
 }
 
 /*-------------------------------------------------------------------------*/
diff --git a/drivers/usb/host/isp1362.h b/drivers/usb/host/isp1362.h
index 208705b08d37..74ca4be24723 100644
--- a/drivers/usb/host/isp1362.h
+++ b/drivers/usb/host/isp1362.h
@@ -435,7 +435,6 @@ struct isp1362_hcd {
 
 	struct isp1362_platform_data *board;
 
-	struct dentry		*debug_file;
 	unsigned long		stat1, stat2, stat4, stat8, stat16;
 
 	/* HC registers */
-- 
2.30.1


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

* [PATCH 3/6] USB: host: sl811: remove dentry pointer for debugfs
  2021-02-16 14:46 [PATCH 1/6] USB: host: isp116x: remove dentry pointer for debugfs Greg Kroah-Hartman
  2021-02-16 14:46 ` [PATCH 2/6] USB: host: isp1362: " Greg Kroah-Hartman
@ 2021-02-16 14:46 ` Greg Kroah-Hartman
  2021-02-16 14:46 ` [PATCH 4/6] USB: host: uhci: " Greg Kroah-Hartman
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-16 14:46 UTC (permalink / raw)
  To: linux-usb; +Cc: Greg Kroah-Hartman

There is no need to keep the dentry pointer around for the created
debugfs file, as it is only needed when removing it from the system.
When it is to be removed, ask debugfs itself for the pointer, to save on
storage and make things a bit simpler.

Cc: linux-usb@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/host/sl811-hcd.c | 7 +++----
 drivers/usb/host/sl811.h     | 1 -
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
index 115ced0d93e1..d49fb656d34b 100644
--- a/drivers/usb/host/sl811-hcd.c
+++ b/drivers/usb/host/sl811-hcd.c
@@ -1496,14 +1496,13 @@ DEFINE_SHOW_ATTRIBUTE(sl811h_debug);
 /* expect just one sl811 per system */
 static void create_debug_file(struct sl811 *sl811)
 {
-	sl811->debug_file = debugfs_create_file("sl811h", S_IRUGO,
-						usb_debug_root, sl811,
-						&sl811h_debug_fops);
+	debugfs_create_file("sl811h", S_IRUGO, usb_debug_root, sl811,
+			    &sl811h_debug_fops);
 }
 
 static void remove_debug_file(struct sl811 *sl811)
 {
-	debugfs_remove(sl811->debug_file);
+	debugfs_remove(debugfs_lookup("sl811h", usb_debug_root));
 }
 
 /*-------------------------------------------------------------------------*/
diff --git a/drivers/usb/host/sl811.h b/drivers/usb/host/sl811.h
index 2abe51a5db44..ba8c9aa7dee8 100644
--- a/drivers/usb/host/sl811.h
+++ b/drivers/usb/host/sl811.h
@@ -123,7 +123,6 @@ struct sl811 {
 	void __iomem		*addr_reg;
 	void __iomem		*data_reg;
 	struct sl811_platform_data	*board;
-	struct dentry 		*debug_file;
 
 	unsigned long		stat_insrmv;
 	unsigned long		stat_wake;
-- 
2.30.1


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

* [PATCH 4/6] USB: host: uhci: remove dentry pointer for debugfs
  2021-02-16 14:46 [PATCH 1/6] USB: host: isp116x: remove dentry pointer for debugfs Greg Kroah-Hartman
  2021-02-16 14:46 ` [PATCH 2/6] USB: host: isp1362: " Greg Kroah-Hartman
  2021-02-16 14:46 ` [PATCH 3/6] USB: host: sl811: " Greg Kroah-Hartman
@ 2021-02-16 14:46 ` Greg Kroah-Hartman
  2021-02-16 14:46 ` [PATCH 5/6] USB: typec: fusb302: create debugfs subdir for the driver Greg Kroah-Hartman
  2021-02-16 14:46 ` [PATCH 6/6] USB: typec: tcpm: " Greg Kroah-Hartman
  4 siblings, 0 replies; 11+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-16 14:46 UTC (permalink / raw)
  To: linux-usb; +Cc: Greg Kroah-Hartman, Alan Stern

There is no need to keep the dentry pointer around for the created
debugfs file, as it is only needed when removing it from the system.
When it is to be removed, ask debugfs itself for the pointer, to save on
storage and make things a bit simpler.

And, no one noticed that a __maybe_unused dentry * in uhci_start()
really was unused, so remove that as it's obviously not needed, and
hasn't been for quite some time.

Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/host/uhci-hcd.c | 12 +++++-------
 drivers/usb/host/uhci-hcd.h |  4 ----
 2 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
index 03bc59755123..d90b869f5f40 100644
--- a/drivers/usb/host/uhci-hcd.c
+++ b/drivers/usb/host/uhci-hcd.c
@@ -536,7 +536,8 @@ static void release_uhci(struct uhci_hcd *uhci)
 	uhci->is_initialized = 0;
 	spin_unlock_irq(&uhci->lock);
 
-	debugfs_remove(uhci->dentry);
+	debugfs_remove(debugfs_lookup(uhci_to_hcd(uhci)->self.bus_name,
+				      uhci_debugfs_root));
 
 	for (i = 0; i < UHCI_NUM_SKELQH; i++)
 		uhci_free_qh(uhci, uhci->skelqh[i]);
@@ -577,7 +578,6 @@ static int uhci_start(struct usb_hcd *hcd)
 	struct uhci_hcd *uhci = hcd_to_uhci(hcd);
 	int retval = -EBUSY;
 	int i;
-	struct dentry __maybe_unused *dentry;
 
 	hcd->uses_new_polling = 1;
 	/* Accept arbitrarily long scatter-gather lists */
@@ -590,10 +590,8 @@ static int uhci_start(struct usb_hcd *hcd)
 	init_waitqueue_head(&uhci->waitqh);
 
 #ifdef UHCI_DEBUG_OPS
-	uhci->dentry = debugfs_create_file(hcd->self.bus_name,
-					   S_IFREG|S_IRUGO|S_IWUSR,
-					   uhci_debugfs_root, uhci,
-					   &uhci_debug_operations);
+	debugfs_create_file(hcd->self.bus_name, S_IFREG|S_IRUGO|S_IWUSR,
+			    uhci_debugfs_root, uhci, &uhci_debug_operations);
 #endif
 
 	uhci->frame = dma_alloc_coherent(uhci_dev(uhci),
@@ -702,7 +700,7 @@ static int uhci_start(struct usb_hcd *hcd)
 			uhci->frame, uhci->frame_dma_handle);
 
 err_alloc_frame:
-	debugfs_remove(uhci->dentry);
+	debugfs_remove(debugfs_lookup(hcd->self.bus_name, uhci_debugfs_root));
 
 	return retval;
 }
diff --git a/drivers/usb/host/uhci-hcd.h b/drivers/usb/host/uhci-hcd.h
index 7f9f33c8c232..8ae5ccd26753 100644
--- a/drivers/usb/host/uhci-hcd.h
+++ b/drivers/usb/host/uhci-hcd.h
@@ -381,10 +381,6 @@ enum uhci_rh_state {
  * The full UHCI controller information:
  */
 struct uhci_hcd {
-
-	/* debugfs */
-	struct dentry *dentry;
-
 	/* Grabbed from PCI */
 	unsigned long io_addr;
 
-- 
2.30.1


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

* [PATCH 5/6] USB: typec: fusb302: create debugfs subdir for the driver
  2021-02-16 14:46 [PATCH 1/6] USB: host: isp116x: remove dentry pointer for debugfs Greg Kroah-Hartman
                   ` (2 preceding siblings ...)
  2021-02-16 14:46 ` [PATCH 4/6] USB: host: uhci: " Greg Kroah-Hartman
@ 2021-02-16 14:46 ` Greg Kroah-Hartman
  2021-02-16 15:24   ` Guenter Roeck
  2021-03-01 15:15   ` Heikki Krogerus
  2021-02-16 14:46 ` [PATCH 6/6] USB: typec: tcpm: " Greg Kroah-Hartman
  4 siblings, 2 replies; 11+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-16 14:46 UTC (permalink / raw)
  To: linux-usb; +Cc: Greg Kroah-Hartman, Guenter Roeck, Heikki Krogerus

The single debugfs file for this driver really is a log file, so make a
subdir and call it "log" to make it obvious this is what it is for.
This makes cleanup simpler as we just remove the whole directory, no
need to handle individual files anymore.

Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/typec/tcpm/fusb302.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c
index ebc46b9f776c..7a2a17866a82 100644
--- a/drivers/usb/typec/tcpm/fusb302.c
+++ b/drivers/usb/typec/tcpm/fusb302.c
@@ -213,8 +213,9 @@ static void fusb302_debugfs_init(struct fusb302_chip *chip)
 
 	mutex_init(&chip->logbuffer_lock);
 	snprintf(name, NAME_MAX, "fusb302-%s", dev_name(chip->dev));
-	chip->dentry = debugfs_create_file(name, S_IFREG | 0444, usb_debug_root,
-					   chip, &fusb302_debug_fops);
+	chip->dentry = debugfs_create_dir(name, usb_debug_root);
+	debugfs_create_file("log", S_IFREG | 0444, chip->dentry, chip,
+			    &fusb302_debug_fops);
 }
 
 static void fusb302_debugfs_exit(struct fusb302_chip *chip)
-- 
2.30.1


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

* [PATCH 6/6] USB: typec: tcpm: create debugfs subdir for the driver
  2021-02-16 14:46 [PATCH 1/6] USB: host: isp116x: remove dentry pointer for debugfs Greg Kroah-Hartman
                   ` (3 preceding siblings ...)
  2021-02-16 14:46 ` [PATCH 5/6] USB: typec: fusb302: create debugfs subdir for the driver Greg Kroah-Hartman
@ 2021-02-16 14:46 ` Greg Kroah-Hartman
  2021-02-16 15:22   ` Guenter Roeck
  2021-03-01 15:16   ` Heikki Krogerus
  4 siblings, 2 replies; 11+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-16 14:46 UTC (permalink / raw)
  To: linux-usb; +Cc: Greg Kroah-Hartman, Guenter Roeck, Heikki Krogerus

The single debugfs file for this driver really is a log file, so make a
subdir and call it "log" to make it obvious this is what it is for.
This makes cleanup simpler as we just remove the whole directory, no
need to handle individual files anymore.

Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/typec/tcpm/tcpm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
index 22a85b396f69..d4dd40c95a56 100644
--- a/drivers/usb/typec/tcpm/tcpm.c
+++ b/drivers/usb/typec/tcpm/tcpm.c
@@ -636,8 +636,9 @@ static void tcpm_debugfs_init(struct tcpm_port *port)
 
 	mutex_init(&port->logbuffer_lock);
 	snprintf(name, NAME_MAX, "tcpm-%s", dev_name(port->dev));
-	port->dentry = debugfs_create_file(name, S_IFREG | 0444, usb_debug_root,
-					   port, &tcpm_debug_fops);
+	port->dentry = debugfs_create_dir(name, usb_debug_root);
+	debugfs_create_file("log", S_IFREG | 0444, port->dentry, port,
+			    &tcpm_debug_fops);
 }
 
 static void tcpm_debugfs_exit(struct tcpm_port *port)
-- 
2.30.1


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

* Re: [PATCH 6/6] USB: typec: tcpm: create debugfs subdir for the driver
  2021-02-16 14:46 ` [PATCH 6/6] USB: typec: tcpm: " Greg Kroah-Hartman
@ 2021-02-16 15:22   ` Guenter Roeck
  2021-03-01 15:16   ` Heikki Krogerus
  1 sibling, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2021-02-16 15:22 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-usb; +Cc: Heikki Krogerus

On 2/16/21 6:46 AM, Greg Kroah-Hartman wrote:
> The single debugfs file for this driver really is a log file, so make a
> subdir and call it "log" to make it obvious this is what it is for.
> This makes cleanup simpler as we just remove the whole directory, no
> need to handle individual files anymore.
> 
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Cc: linux-usb@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/usb/typec/tcpm/tcpm.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index 22a85b396f69..d4dd40c95a56 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -636,8 +636,9 @@ static void tcpm_debugfs_init(struct tcpm_port *port)
>  
>  	mutex_init(&port->logbuffer_lock);
>  	snprintf(name, NAME_MAX, "tcpm-%s", dev_name(port->dev));
> -	port->dentry = debugfs_create_file(name, S_IFREG | 0444, usb_debug_root,
> -					   port, &tcpm_debug_fops);
> +	port->dentry = debugfs_create_dir(name, usb_debug_root);
> +	debugfs_create_file("log", S_IFREG | 0444, port->dentry, port,
> +			    &tcpm_debug_fops);
>  }
>  
>  static void tcpm_debugfs_exit(struct tcpm_port *port)
> 


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

* Re: [PATCH 5/6] USB: typec: fusb302: create debugfs subdir for the driver
  2021-02-16 14:46 ` [PATCH 5/6] USB: typec: fusb302: create debugfs subdir for the driver Greg Kroah-Hartman
@ 2021-02-16 15:24   ` Guenter Roeck
  2021-03-02  7:32     ` Greg Kroah-Hartman
  2021-03-01 15:15   ` Heikki Krogerus
  1 sibling, 1 reply; 11+ messages in thread
From: Guenter Roeck @ 2021-02-16 15:24 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-usb; +Cc: Heikki Krogerus

On 2/16/21 6:46 AM, Greg Kroah-Hartman wrote:
> The single debugfs file for this driver really is a log file, so make a
> subdir and call it "log" to make it obvious this is what it is for.
> This makes cleanup simpler as we just remove the whole directory, no
> need to handle individual files anymore.
> 
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Cc: linux-usb@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

I'd probably have explored the possibility to group files like this
under the newly created tcpm debugfs directory, but that is really
a nitpick.

Guenter

> ---
>  drivers/usb/typec/tcpm/fusb302.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c
> index ebc46b9f776c..7a2a17866a82 100644
> --- a/drivers/usb/typec/tcpm/fusb302.c
> +++ b/drivers/usb/typec/tcpm/fusb302.c
> @@ -213,8 +213,9 @@ static void fusb302_debugfs_init(struct fusb302_chip *chip)
>  
>  	mutex_init(&chip->logbuffer_lock);
>  	snprintf(name, NAME_MAX, "fusb302-%s", dev_name(chip->dev));
> -	chip->dentry = debugfs_create_file(name, S_IFREG | 0444, usb_debug_root,
> -					   chip, &fusb302_debug_fops);
> +	chip->dentry = debugfs_create_dir(name, usb_debug_root);
> +	debugfs_create_file("log", S_IFREG | 0444, chip->dentry, chip,
> +			    &fusb302_debug_fops);
>  }
>  
>  static void fusb302_debugfs_exit(struct fusb302_chip *chip)
> 


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

* Re: [PATCH 5/6] USB: typec: fusb302: create debugfs subdir for the driver
  2021-02-16 14:46 ` [PATCH 5/6] USB: typec: fusb302: create debugfs subdir for the driver Greg Kroah-Hartman
  2021-02-16 15:24   ` Guenter Roeck
@ 2021-03-01 15:15   ` Heikki Krogerus
  1 sibling, 0 replies; 11+ messages in thread
From: Heikki Krogerus @ 2021-03-01 15:15 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb, Guenter Roeck

On Tue, Feb 16, 2021 at 03:46:44PM +0100, Greg Kroah-Hartman wrote:
> The single debugfs file for this driver really is a log file, so make a
> subdir and call it "log" to make it obvious this is what it is for.
> This makes cleanup simpler as we just remove the whole directory, no
> need to handle individual files anymore.
> 
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Cc: linux-usb@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/tcpm/fusb302.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c
> index ebc46b9f776c..7a2a17866a82 100644
> --- a/drivers/usb/typec/tcpm/fusb302.c
> +++ b/drivers/usb/typec/tcpm/fusb302.c
> @@ -213,8 +213,9 @@ static void fusb302_debugfs_init(struct fusb302_chip *chip)
>  
>  	mutex_init(&chip->logbuffer_lock);
>  	snprintf(name, NAME_MAX, "fusb302-%s", dev_name(chip->dev));
> -	chip->dentry = debugfs_create_file(name, S_IFREG | 0444, usb_debug_root,
> -					   chip, &fusb302_debug_fops);
> +	chip->dentry = debugfs_create_dir(name, usb_debug_root);
> +	debugfs_create_file("log", S_IFREG | 0444, chip->dentry, chip,
> +			    &fusb302_debug_fops);
>  }
>  
>  static void fusb302_debugfs_exit(struct fusb302_chip *chip)
> -- 
> 2.30.1

-- 
heikki

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

* Re: [PATCH 6/6] USB: typec: tcpm: create debugfs subdir for the driver
  2021-02-16 14:46 ` [PATCH 6/6] USB: typec: tcpm: " Greg Kroah-Hartman
  2021-02-16 15:22   ` Guenter Roeck
@ 2021-03-01 15:16   ` Heikki Krogerus
  1 sibling, 0 replies; 11+ messages in thread
From: Heikki Krogerus @ 2021-03-01 15:16 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb, Guenter Roeck

On Tue, Feb 16, 2021 at 03:46:45PM +0100, Greg Kroah-Hartman wrote:
> The single debugfs file for this driver really is a log file, so make a
> subdir and call it "log" to make it obvious this is what it is for.
> This makes cleanup simpler as we just remove the whole directory, no
> need to handle individual files anymore.
> 
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Cc: linux-usb@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/tcpm/tcpm.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index 22a85b396f69..d4dd40c95a56 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -636,8 +636,9 @@ static void tcpm_debugfs_init(struct tcpm_port *port)
>  
>  	mutex_init(&port->logbuffer_lock);
>  	snprintf(name, NAME_MAX, "tcpm-%s", dev_name(port->dev));
> -	port->dentry = debugfs_create_file(name, S_IFREG | 0444, usb_debug_root,
> -					   port, &tcpm_debug_fops);
> +	port->dentry = debugfs_create_dir(name, usb_debug_root);
> +	debugfs_create_file("log", S_IFREG | 0444, port->dentry, port,
> +			    &tcpm_debug_fops);
>  }
>  
>  static void tcpm_debugfs_exit(struct tcpm_port *port)
> -- 
> 2.30.1

-- 
heikki

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

* Re: [PATCH 5/6] USB: typec: fusb302: create debugfs subdir for the driver
  2021-02-16 15:24   ` Guenter Roeck
@ 2021-03-02  7:32     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 11+ messages in thread
From: Greg Kroah-Hartman @ 2021-03-02  7:32 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-usb, Heikki Krogerus

On Tue, Feb 16, 2021 at 07:24:14AM -0800, Guenter Roeck wrote:
> On 2/16/21 6:46 AM, Greg Kroah-Hartman wrote:
> > The single debugfs file for this driver really is a log file, so make a
> > subdir and call it "log" to make it obvious this is what it is for.
> > This makes cleanup simpler as we just remove the whole directory, no
> > need to handle individual files anymore.
> > 
> > Cc: Guenter Roeck <linux@roeck-us.net>
> > Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> > Cc: linux-usb@vger.kernel.org
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> 
> I'd probably have explored the possibility to group files like this
> under the newly created tcpm debugfs directory, but that is really
> a nitpick.

Good idea, I'll look into doing that next...

thanks,

greg k-h

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

end of thread, other threads:[~2021-03-02 11:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-16 14:46 [PATCH 1/6] USB: host: isp116x: remove dentry pointer for debugfs Greg Kroah-Hartman
2021-02-16 14:46 ` [PATCH 2/6] USB: host: isp1362: " Greg Kroah-Hartman
2021-02-16 14:46 ` [PATCH 3/6] USB: host: sl811: " Greg Kroah-Hartman
2021-02-16 14:46 ` [PATCH 4/6] USB: host: uhci: " Greg Kroah-Hartman
2021-02-16 14:46 ` [PATCH 5/6] USB: typec: fusb302: create debugfs subdir for the driver Greg Kroah-Hartman
2021-02-16 15:24   ` Guenter Roeck
2021-03-02  7:32     ` Greg Kroah-Hartman
2021-03-01 15:15   ` Heikki Krogerus
2021-02-16 14:46 ` [PATCH 6/6] USB: typec: tcpm: " Greg Kroah-Hartman
2021-02-16 15:22   ` Guenter Roeck
2021-03-01 15:16   ` Heikki Krogerus

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.