net: wwan: iosm: drop debugfs dev reference
authorM Chetan Kumar <m.chetan.kumar@linux.intel.com>
Mon, 14 Feb 2022 07:16:53 +0000 (12:46 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Feb 2022 14:09:59 +0000 (14:09 +0000)
Post debugfs use call wwan_put_debugfs_dir()to drop
debugfs dev reference.

Signed-off-by: M Chetan Kumar <m.chetan.kumar@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wwan/iosm/iosm_ipc_debugfs.c
drivers/net/wwan/iosm/iosm_ipc_imem.h

index f2f5775..e916139 100644 (file)
 
 void ipc_debugfs_init(struct iosm_imem *ipc_imem)
 {
-       struct dentry *debugfs_pdev = wwan_get_debugfs_dir(ipc_imem->dev);
+       ipc_imem->debugfs_wwan_dir = wwan_get_debugfs_dir(ipc_imem->dev);
 
        ipc_imem->debugfs_dir = debugfs_create_dir(KBUILD_MODNAME,
-                                                  debugfs_pdev);
+                                                  ipc_imem->debugfs_wwan_dir);
 
        ipc_imem->trace = ipc_trace_init(ipc_imem);
        if (!ipc_imem->trace)
@@ -26,4 +26,5 @@ void ipc_debugfs_deinit(struct iosm_imem *ipc_imem)
 {
        ipc_trace_deinit(ipc_imem->trace);
        debugfs_remove_recursive(ipc_imem->debugfs_dir);
+       wwan_put_debugfs_dir(ipc_imem->debugfs_wwan_dir);
 }
index 5682e8d..e700dc8 100644 (file)
@@ -341,6 +341,7 @@ enum ipc_phase {
  * @ev_mux_net_transmit_pending:0 means inform the IPC tasklet to pass
  * @reset_det_n:               Reset detect flag
  * @pcie_wake_n:               Pcie wake flag
+ * @debugfs_wwan_dir:          WWAN Debug FS directory entry
  * @debugfs_dir:               Debug FS directory for driver-specific entries
  */
 struct iosm_imem {
@@ -384,6 +385,7 @@ struct iosm_imem {
           reset_det_n:1,
           pcie_wake_n:1;
 #ifdef CONFIG_WWAN_DEBUGFS
+       struct dentry *debugfs_wwan_dir;
        struct dentry *debugfs_dir;
 #endif
 };