ar71xx: ag71xx: use debugfs_remove_recursive
authorGabor Juhos <juhosg@openwrt.org>
Sat, 7 May 2011 12:40:25 +0000 (12:40 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Sat, 7 May 2011 12:40:25 +0000 (12:40 +0000)
SVN-Revision: 26842

target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx.h
target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_debugfs.c

index bb4cb5ba9ff96b3db1e7c6f5149bef2b207ce6c1..06bdb35c931b08a4c6703096a4c480fd80e2f924 100644 (file)
@@ -136,8 +136,6 @@ struct ag71xx_napi_stats {
 
 struct ag71xx_debug {
        struct dentry           *debugfs_dir;
-       struct dentry           *debugfs_int_stats;
-       struct dentry           *debugfs_napi_stats;
 
        struct ag71xx_int_stats int_stats;
        struct ag71xx_napi_stats napi_stats;
index 8111cad3557dd2d4a5e06ed9b4e528db2bfd024d..eca090521858a7089bcd525a3dfec34b39ec5cc5 100644 (file)
@@ -141,9 +141,7 @@ static const struct file_operations ag71xx_fops_napi_stats = {
 
 void ag71xx_debugfs_exit(struct ag71xx *ag)
 {
-       debugfs_remove(ag->debug.debugfs_napi_stats);
-       debugfs_remove(ag->debug.debugfs_int_stats);
-       debugfs_remove(ag->debug.debugfs_dir);
+       debugfs_remove_recursive(ag->debug.debugfs_dir);
 }
 
 int ag71xx_debugfs_init(struct ag71xx *ag)
@@ -151,31 +149,14 @@ int ag71xx_debugfs_init(struct ag71xx *ag)
        ag->debug.debugfs_dir = debugfs_create_dir(ag->dev->name,
                                                   ag71xx_debugfs_root);
        if (!ag->debug.debugfs_dir)
-               goto err;
-
-       ag->debug.debugfs_int_stats =
-                       debugfs_create_file("int_stats",
-                                           S_IRUGO,
-                                           ag->debug.debugfs_dir,
-                                           ag,
-                                           &ag71xx_fops_int_stats);
-       if (!ag->debug.debugfs_int_stats)
-               goto err;
-
-       ag->debug.debugfs_napi_stats =
-                       debugfs_create_file("napi_stats",
-                                           S_IRUGO,
-                                           ag->debug.debugfs_dir,
-                                           ag,
-                                           &ag71xx_fops_napi_stats);
-       if (!ag->debug.debugfs_napi_stats)
-               goto err;
+               return -ENOMEM;
 
-       return 0;
+       debugfs_create_file("int_stats", S_IRUGO, ag->debug.debugfs_dir,
+                           ag, &ag71xx_fops_int_stats);
+       debugfs_create_file("napi_stats", S_IRUGO, ag->debug.debugfs_dir,
+                           ag, &ag71xx_fops_napi_stats);
 
-err:
-       ag71xx_debugfs_exit(ag);
-       return -ENOMEM;
+       return 0;
 }
 
 int ag71xx_debugfs_root_init(void)