struct ag71xx_debug {
struct dentry *debugfs_dir;
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;
struct ag71xx_int_stats int_stats;
struct ag71xx_napi_stats napi_stats;
void ag71xx_debugfs_exit(struct ag71xx *ag)
{
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)
}
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)
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;
+ 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;
}
int ag71xx_debugfs_root_init(void)
}
int ag71xx_debugfs_root_init(void)