aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-tegra/clock.c7
-rw-r--r--arch/arm/mach-ux500/clock.c20
-rw-r--r--arch/arm/plat-omap/clock.c6
-rw-r--r--arch/arm/plat-samsung/clock.c7
-rw-r--r--arch/arm/plat-spear/clock.c7
5 files changed, 11 insertions, 36 deletions
diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c
index e028320ab423..f8d41ffc0ca9 100644
--- a/arch/arm/mach-tegra/clock.c
+++ b/arch/arm/mach-tegra/clock.c
@@ -585,7 +585,7 @@ static const struct file_operations possible_parents_fops = {
585 585
586static int clk_debugfs_register_one(struct clk *c) 586static int clk_debugfs_register_one(struct clk *c)
587{ 587{
588 struct dentry *d, *child, *child_tmp; 588 struct dentry *d;
589 589
590 d = debugfs_create_dir(c->name, clk_debugfs_root); 590 d = debugfs_create_dir(c->name, clk_debugfs_root);
591 if (!d) 591 if (!d)
@@ -614,10 +614,7 @@ static int clk_debugfs_register_one(struct clk *c)
614 return 0; 614 return 0;
615 615
616err_out: 616err_out:
617 d = c->dent; 617 debugfs_remove_recursive(c->dent);
618 list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
619 debugfs_remove(child);
620 debugfs_remove(c->dent);
621 return -ENOMEM; 618 return -ENOMEM;
622} 619}
623 620
diff --git a/arch/arm/mach-ux500/clock.c b/arch/arm/mach-ux500/clock.c
index 32ce90840ee1..1d8509d59c09 100644
--- a/arch/arm/mach-ux500/clock.c
+++ b/arch/arm/mach-ux500/clock.c
@@ -635,7 +635,7 @@ static const struct file_operations set_rate_fops = {
635static struct dentry *clk_debugfs_register_dir(struct clk *c, 635static struct dentry *clk_debugfs_register_dir(struct clk *c,
636 struct dentry *p_dentry) 636 struct dentry *p_dentry)
637{ 637{
638 struct dentry *d, *clk_d, *child, *child_tmp; 638 struct dentry *d, *clk_d;
639 char s[255]; 639 char s[255];
640 char *p = s; 640 char *p = s;
641 641
@@ -666,24 +666,10 @@ static struct dentry *clk_debugfs_register_dir(struct clk *c,
666 return clk_d; 666 return clk_d;
667 667
668err_out: 668err_out:
669 d = clk_d; 669 debugfs_remove_recursive(clk_d);
670 list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
671 debugfs_remove(child);
672 debugfs_remove(clk_d);
673 return NULL; 670 return NULL;
674} 671}
675 672
676static void clk_debugfs_remove_dir(struct dentry *cdentry)
677{
678 struct dentry *d, *child, *child_tmp;
679
680 d = cdentry;
681 list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
682 debugfs_remove(child);
683 debugfs_remove(cdentry);
684 return ;
685}
686
687static int clk_debugfs_register_one(struct clk *c) 673static int clk_debugfs_register_one(struct clk *c)
688{ 674{
689 struct clk *pa = c->parent_periph; 675 struct clk *pa = c->parent_periph;
@@ -700,7 +686,7 @@ static int clk_debugfs_register_one(struct clk *c)
700 c->dent_bus = clk_debugfs_register_dir(c, 686 c->dent_bus = clk_debugfs_register_dir(c,
701 bpa->dent_bus ? bpa->dent_bus : bpa->dent); 687 bpa->dent_bus ? bpa->dent_bus : bpa->dent);
702 if ((!c->dent_bus) && (c->dent)) { 688 if ((!c->dent_bus) && (c->dent)) {
703 clk_debugfs_remove_dir(c->dent); 689 debugfs_remove_recursive(c->dent);
704 c->dent = NULL; 690 c->dent = NULL;
705 return -ENOMEM; 691 return -ENOMEM;
706 } 692 }
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
index c9122dd6ee8d..43bae2c1e34d 100644
--- a/arch/arm/plat-omap/clock.c
+++ b/arch/arm/plat-omap/clock.c
@@ -480,7 +480,7 @@ static struct dentry *clk_debugfs_root;
480static int clk_debugfs_register_one(struct clk *c) 480static int clk_debugfs_register_one(struct clk *c)
481{ 481{
482 int err; 482 int err;
483 struct dentry *d, *child, *child_tmp; 483 struct dentry *d;
484 struct clk *pa = c->parent; 484 struct clk *pa = c->parent;
485 char s[255]; 485 char s[255];
486 char *p = s; 486 char *p = s;
@@ -510,9 +510,7 @@ static int clk_debugfs_register_one(struct clk *c)
510 510
511err_out: 511err_out:
512 d = c->dent; 512 d = c->dent;
513 list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child) 513 debugfs_remove_recursive(c->dent);
514 debugfs_remove(child);
515 debugfs_remove(c->dent);
516 return err; 514 return err;
517} 515}
518 516
diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c
index 772892826ffc..0c9f95d98561 100644
--- a/arch/arm/plat-samsung/clock.c
+++ b/arch/arm/plat-samsung/clock.c
@@ -458,7 +458,7 @@ static struct dentry *clk_debugfs_root;
458static int clk_debugfs_register_one(struct clk *c) 458static int clk_debugfs_register_one(struct clk *c)
459{ 459{
460 int err; 460 int err;
461 struct dentry *d, *child, *child_tmp; 461 struct dentry *d;
462 struct clk *pa = c->parent; 462 struct clk *pa = c->parent;
463 char s[255]; 463 char s[255];
464 char *p = s; 464 char *p = s;
@@ -488,10 +488,7 @@ static int clk_debugfs_register_one(struct clk *c)
488 return 0; 488 return 0;
489 489
490err_out: 490err_out:
491 d = c->dent; 491 debugfs_remove_recursive(c->dent);
492 list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
493 debugfs_remove(child);
494 debugfs_remove(c->dent);
495 return err; 492 return err;
496} 493}
497 494
diff --git a/arch/arm/plat-spear/clock.c b/arch/arm/plat-spear/clock.c
index 6fa474cb398e..67dd00381ea6 100644
--- a/arch/arm/plat-spear/clock.c
+++ b/arch/arm/plat-spear/clock.c
@@ -916,7 +916,7 @@ static struct dentry *clk_debugfs_root;
916static int clk_debugfs_register_one(struct clk *c) 916static int clk_debugfs_register_one(struct clk *c)
917{ 917{
918 int err; 918 int err;
919 struct dentry *d, *child; 919 struct dentry *d;
920 struct clk *pa = c->pclk; 920 struct clk *pa = c->pclk;
921 char s[255]; 921 char s[255];
922 char *p = s; 922 char *p = s;
@@ -951,10 +951,7 @@ static int clk_debugfs_register_one(struct clk *c)
951 return 0; 951 return 0;
952 952
953err_out: 953err_out:
954 d = c->dent; 954 debugfs_remove_recursive(c->dent);
955 list_for_each_entry(child, &d->d_subdirs, d_u.d_child)
956 debugfs_remove(child);
957 debugfs_remove(c->dent);
958 return err; 955 return err;
959} 956}
960 957