iwlwifi: create drivers debugfs dir under wiphy->debugfsdir
authorZhu Yi <yi.zhu@intel.com>
Thu, 29 May 2008 08:34:50 +0000 (16:34 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 3 Jun 2008 19:00:19 +0000 (15:00 -0400)
This patch creates driver's debugfs tree under wiphy->debugfsdir.
This patch fixes collision in debugfs if two or more NICs are plugged.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-debugfs.c

index c64e602bc9b65a47c4444f006864d197b3b4ec64..29e16ba69cdb42f1796e240a5f2676dc15d2e190 100644 (file)
@@ -367,6 +367,7 @@ DEBUGFS_READ_FILE_OPS(tx_statistics);
 int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
 {
        struct iwl_debugfs *dbgfs;
+       struct dentry *phyd = priv->hw->wiphy->debugfsdir;
 
        dbgfs = kzalloc(sizeof(struct iwl_debugfs), GFP_KERNEL);
        if (!dbgfs) {
@@ -375,7 +376,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
 
        priv->dbgfs = dbgfs;
        dbgfs->name = name;
-       dbgfs->dir_drv = debugfs_create_dir(name, NULL);
+       dbgfs->dir_drv = debugfs_create_dir(name, phyd);
        if (!dbgfs->dir_drv || IS_ERR(dbgfs->dir_drv)){
                goto err;
        }