Commit 12520c43 authored by Al Viro's avatar Al Viro

switch assorted clock drivers to debugfs_remove_recursive()

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent f1514638
...@@ -585,7 +585,7 @@ static const struct file_operations possible_parents_fops = { ...@@ -585,7 +585,7 @@ static const struct file_operations possible_parents_fops = {
static int clk_debugfs_register_one(struct clk *c) static int clk_debugfs_register_one(struct clk *c)
{ {
struct dentry *d, *child, *child_tmp; struct dentry *d;
d = debugfs_create_dir(c->name, clk_debugfs_root); d = debugfs_create_dir(c->name, clk_debugfs_root);
if (!d) if (!d)
...@@ -614,10 +614,7 @@ static int clk_debugfs_register_one(struct clk *c) ...@@ -614,10 +614,7 @@ static int clk_debugfs_register_one(struct clk *c)
return 0; return 0;
err_out: err_out:
d = c->dent; debugfs_remove_recursive(c->dent);
list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
debugfs_remove(child);
debugfs_remove(c->dent);
return -ENOMEM; return -ENOMEM;
} }
......
...@@ -635,7 +635,7 @@ static const struct file_operations set_rate_fops = { ...@@ -635,7 +635,7 @@ static const struct file_operations set_rate_fops = {
static struct dentry *clk_debugfs_register_dir(struct clk *c, static struct dentry *clk_debugfs_register_dir(struct clk *c,
struct dentry *p_dentry) struct dentry *p_dentry)
{ {
struct dentry *d, *clk_d, *child, *child_tmp; struct dentry *d, *clk_d;
char s[255]; char s[255];
char *p = s; char *p = s;
...@@ -666,24 +666,10 @@ static struct dentry *clk_debugfs_register_dir(struct clk *c, ...@@ -666,24 +666,10 @@ static struct dentry *clk_debugfs_register_dir(struct clk *c,
return clk_d; return clk_d;
err_out: err_out:
d = clk_d; debugfs_remove_recursive(clk_d);
list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
debugfs_remove(child);
debugfs_remove(clk_d);
return NULL; return NULL;
} }
static void clk_debugfs_remove_dir(struct dentry *cdentry)
{
struct dentry *d, *child, *child_tmp;
d = cdentry;
list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
debugfs_remove(child);
debugfs_remove(cdentry);
return ;
}
static int clk_debugfs_register_one(struct clk *c) static int clk_debugfs_register_one(struct clk *c)
{ {
struct clk *pa = c->parent_periph; struct clk *pa = c->parent_periph;
...@@ -700,7 +686,7 @@ static int clk_debugfs_register_one(struct clk *c) ...@@ -700,7 +686,7 @@ static int clk_debugfs_register_one(struct clk *c)
c->dent_bus = clk_debugfs_register_dir(c, c->dent_bus = clk_debugfs_register_dir(c,
bpa->dent_bus ? bpa->dent_bus : bpa->dent); bpa->dent_bus ? bpa->dent_bus : bpa->dent);
if ((!c->dent_bus) && (c->dent)) { if ((!c->dent_bus) && (c->dent)) {
clk_debugfs_remove_dir(c->dent); debugfs_remove_recursive(c->dent);
c->dent = NULL; c->dent = NULL;
return -ENOMEM; return -ENOMEM;
} }
......
...@@ -480,7 +480,7 @@ static struct dentry *clk_debugfs_root; ...@@ -480,7 +480,7 @@ static struct dentry *clk_debugfs_root;
static int clk_debugfs_register_one(struct clk *c) static int clk_debugfs_register_one(struct clk *c)
{ {
int err; int err;
struct dentry *d, *child, *child_tmp; struct dentry *d;
struct clk *pa = c->parent; struct clk *pa = c->parent;
char s[255]; char s[255];
char *p = s; char *p = s;
...@@ -510,9 +510,7 @@ static int clk_debugfs_register_one(struct clk *c) ...@@ -510,9 +510,7 @@ static int clk_debugfs_register_one(struct clk *c)
err_out: err_out:
d = c->dent; d = c->dent;
list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child) debugfs_remove_recursive(c->dent);
debugfs_remove(child);
debugfs_remove(c->dent);
return err; return err;
} }
......
...@@ -458,7 +458,7 @@ static struct dentry *clk_debugfs_root; ...@@ -458,7 +458,7 @@ static struct dentry *clk_debugfs_root;
static int clk_debugfs_register_one(struct clk *c) static int clk_debugfs_register_one(struct clk *c)
{ {
int err; int err;
struct dentry *d, *child, *child_tmp; struct dentry *d;
struct clk *pa = c->parent; struct clk *pa = c->parent;
char s[255]; char s[255];
char *p = s; char *p = s;
...@@ -488,10 +488,7 @@ static int clk_debugfs_register_one(struct clk *c) ...@@ -488,10 +488,7 @@ static int clk_debugfs_register_one(struct clk *c)
return 0; return 0;
err_out: err_out:
d = c->dent; debugfs_remove_recursive(c->dent);
list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
debugfs_remove(child);
debugfs_remove(c->dent);
return err; return err;
} }
......
...@@ -916,7 +916,7 @@ static struct dentry *clk_debugfs_root; ...@@ -916,7 +916,7 @@ static struct dentry *clk_debugfs_root;
static int clk_debugfs_register_one(struct clk *c) static int clk_debugfs_register_one(struct clk *c)
{ {
int err; int err;
struct dentry *d, *child; struct dentry *d;
struct clk *pa = c->pclk; struct clk *pa = c->pclk;
char s[255]; char s[255];
char *p = s; char *p = s;
...@@ -951,10 +951,7 @@ static int clk_debugfs_register_one(struct clk *c) ...@@ -951,10 +951,7 @@ static int clk_debugfs_register_one(struct clk *c)
return 0; return 0;
err_out: err_out:
d = c->dent; debugfs_remove_recursive(c->dent);
list_for_each_entry(child, &d->d_subdirs, d_u.d_child)
debugfs_remove(child);
debugfs_remove(c->dent);
return err; return err;
} }
......
...@@ -670,7 +670,7 @@ static struct dentry *clk_debugfs_root; ...@@ -670,7 +670,7 @@ static struct dentry *clk_debugfs_root;
static int clk_debugfs_register_one(struct clk *c) static int clk_debugfs_register_one(struct clk *c)
{ {
int err; int err;
struct dentry *d, *child, *child_tmp; struct dentry *d;
struct clk *pa = c->parent; struct clk *pa = c->parent;
char s[255]; char s[255];
char *p = s; char *p = s;
...@@ -699,10 +699,7 @@ static int clk_debugfs_register_one(struct clk *c) ...@@ -699,10 +699,7 @@ static int clk_debugfs_register_one(struct clk *c)
return 0; return 0;
err_out: err_out:
d = c->dentry; debugfs_remove_recursive(c->dentry);
list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
debugfs_remove(child);
debugfs_remove(c->dentry);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment