]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
switch assorted clock drivers to debugfs_remove_recursive()
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 16 Jul 2011 16:37:57 +0000 (12:37 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 21 Jul 2011 00:47:51 +0000 (20:47 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/arm/mach-tegra/clock.c
arch/arm/mach-ux500/clock.c
arch/arm/plat-omap/clock.c
arch/arm/plat-samsung/clock.c
arch/arm/plat-spear/clock.c
drivers/sh/clk/core.c

index e028320ab423cc4ca7cb1930bc69dd71ee502ed4..f8d41ffc0ca984a5685f8ed5975b27c8c513e5c1 100644 (file)
@@ -585,7 +585,7 @@ static const struct file_operations possible_parents_fops = {
 
 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);
        if (!d)
@@ -614,10 +614,7 @@ static int clk_debugfs_register_one(struct clk *c)
        return 0;
 
 err_out:
-       d = c->dent;
-       list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
-               debugfs_remove(child);
-       debugfs_remove(c->dent);
+       debugfs_remove_recursive(c->dent);
        return -ENOMEM;
 }
 
index 32ce90840ee1509dbc877a037298b956ea18b4ba..1d8509d59c0972e0411667d788ca28fb96dfeac2 100644 (file)
@@ -635,7 +635,7 @@ static const struct file_operations set_rate_fops = {
 static struct dentry *clk_debugfs_register_dir(struct clk *c,
                                                struct dentry *p_dentry)
 {
-       struct dentry *d, *clk_d, *child, *child_tmp;
+       struct dentry *d, *clk_d;
        char s[255];
        char *p = s;
 
@@ -666,24 +666,10 @@ static struct dentry *clk_debugfs_register_dir(struct clk *c,
        return clk_d;
 
 err_out:
-       d = clk_d;
-       list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
-               debugfs_remove(child);
-       debugfs_remove(clk_d);
+       debugfs_remove_recursive(clk_d);
        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)
 {
        struct clk *pa = c->parent_periph;
@@ -700,7 +686,7 @@ static int clk_debugfs_register_one(struct clk *c)
                c->dent_bus = clk_debugfs_register_dir(c,
                                bpa->dent_bus ? bpa->dent_bus : bpa->dent);
                if ((!c->dent_bus) &&  (c->dent)) {
-                       clk_debugfs_remove_dir(c->dent);
+                       debugfs_remove_recursive(c->dent);
                        c->dent = NULL;
                        return -ENOMEM;
                }
index c9122dd6ee8d1691ce6bfb3603b06debbc84ad10..43bae2c1e34d3ef1f2a2763a0afec101f1024fc4 100644 (file)
@@ -480,7 +480,7 @@ static struct dentry *clk_debugfs_root;
 static int clk_debugfs_register_one(struct clk *c)
 {
        int err;
-       struct dentry *d, *child, *child_tmp;
+       struct dentry *d;
        struct clk *pa = c->parent;
        char s[255];
        char *p = s;
@@ -510,9 +510,7 @@ static int clk_debugfs_register_one(struct clk *c)
 
 err_out:
        d = c->dent;
-       list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
-               debugfs_remove(child);
-       debugfs_remove(c->dent);
+       debugfs_remove_recursive(c->dent);
        return err;
 }
 
index 772892826ffc88c59e8b2641a665a7f5169e6446..0c9f95d98561863aa458a415c388f3a821bd7822 100644 (file)
@@ -458,7 +458,7 @@ static struct dentry *clk_debugfs_root;
 static int clk_debugfs_register_one(struct clk *c)
 {
        int err;
-       struct dentry *d, *child, *child_tmp;
+       struct dentry *d;
        struct clk *pa = c->parent;
        char s[255];
        char *p = s;
@@ -488,10 +488,7 @@ static int clk_debugfs_register_one(struct clk *c)
        return 0;
 
 err_out:
-       d = c->dent;
-       list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
-               debugfs_remove(child);
-       debugfs_remove(c->dent);
+       debugfs_remove_recursive(c->dent);
        return err;
 }
 
index 6fa474cb398e1c33da5a24c3b528fbf72875ff49..67dd00381ea69bfb7a742c599df4c0c6236c8402 100644 (file)
@@ -916,7 +916,7 @@ static struct dentry *clk_debugfs_root;
 static int clk_debugfs_register_one(struct clk *c)
 {
        int err;
-       struct dentry *d, *child;
+       struct dentry *d;
        struct clk *pa = c->pclk;
        char s[255];
        char *p = s;
@@ -951,10 +951,7 @@ static int clk_debugfs_register_one(struct clk *c)
        return 0;
 
 err_out:
-       d = c->dent;
-       list_for_each_entry(child, &d->d_subdirs, d_u.d_child)
-               debugfs_remove(child);
-       debugfs_remove(c->dent);
+       debugfs_remove_recursive(c->dent);
        return err;
 }
 
index 7e9c39951ecb87c086c9ab439df893a5c0980752..d6702e57d4285d150b2a94b6b94a6caf60652bc1 100644 (file)
@@ -670,7 +670,7 @@ static struct dentry *clk_debugfs_root;
 static int clk_debugfs_register_one(struct clk *c)
 {
        int err;
-       struct dentry *d, *child, *child_tmp;
+       struct dentry *d;
        struct clk *pa = c->parent;
        char s[255];
        char *p = s;
@@ -699,10 +699,7 @@ static int clk_debugfs_register_one(struct clk *c)
        return 0;
 
 err_out:
-       d = c->dentry;
-       list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
-               debugfs_remove(child);
-       debugfs_remove(c->dentry);
+       debugfs_remove_recursive(c->dentry);
        return err;
 }