Skip to contentSkip to conversation

ARM: SAMSUNG: Add support for clock debugging through debug-fs interface

PATCH Superseded Amit Daniel Kachhap 2 participants 4 messages Nov 26, 2010 – Jan 12, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ARM: SAMSUNG: Add support for clock debugging through debug-fs interface

This patch adds support for clock information exposed to debug-fs interface.

---
Code modified for V2 version are,
a)Inserted the debug-fs code inside macro CONFIG_PM_DEBUG as suggested by yong.shen at linaro.org.
b)Removed macro CONFIG_PLAT_SAMSUNG and implemented other coding standards as suggested by kgene.kim at samsung.com

 arch/arm/plat-samsung/clock.c              |   91 ++++++++++++++++++++++++++++
 arch/arm/plat-samsung/include/plat/clock.h |    3 +
 2 files changed, 94 insertions(+), 0 deletions(-)
arch/arm/plat-samsung/clock.c +91 -0
index e8d20b0..029a49d 100644
@@ -39,6 +39,9 @@
 #include <linux/clk.h>
 #include <linux/spinlock.h>
 #include <linux/io.h>
+#if defined(CONFIG_DEBUG_FS)
+#include <linux/debugfs.h>
+#endif
 
 #include <mach/hardware.h>
 #include <asm/irq.h>
@@ -447,3 +450,91 @@ int __init s3c24xx_register_baseclocks(unsigned long xtal)
 	return 0;
 }
 
+#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
+/* debugfs support to trace clock tree hierarchy and attributes */
+
+static struct dentry *clk_debugfs_root;
+
+static int clk_debugfs_register_one(struct clk *c)
+{
+	int err;
+	struct dentry *d, *child, *child_tmp;
+	struct clk *pa = c->parent;
+	char s[255];
+	char *p = s;
+
+	p += sprintf(p, "%s", c->name);
+	/*Append id field with name also*/
+	if (c->id >= 0)
+		sprintf(p, ":%d", c->id);
+
+	d = debugfs_create_dir(s, pa ? pa->dent : clk_debugfs_root);
+	if (!d)
+		return -ENOMEM;
+
+	c->dent = d;
+
+	d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8 *)&c->usage);
+	if (!d) {
+		err = -ENOMEM;
+		goto err_out;
+	}
+	d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate);
+	if (!d) {
+		err = -ENOMEM;
+		goto err_out;
+	}
+	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);
+	return err;
+}
+
+static int clk_debugfs_register(struct clk *c)
+{
+	int err;
+	struct clk *pa = c->parent;
+
+	if (pa && !pa->dent) {
+		err = clk_debugfs_register(pa);
+		if (err)
+			return err;
+	}
+
+	if (!c->dent) {
+		err = clk_debugfs_register_one(c);
+		if (err)
+			return err;
+	}
+	return 0;
+}
+
+static int __init clk_debugfs_init(void)
+{
+	struct clk *c;
+	struct dentry *d;
+	int err;
+
+	d = debugfs_create_dir("clock", NULL);
+	if (!d)
+		return -ENOMEM;
+	clk_debugfs_root = d;
+
+	list_for_each_entry(c, &clocks, list) {
+		err = clk_debugfs_register(c);
+		if (err)
+			goto err_out;
+	}
+	return 0;
+err_out:
+	debugfs_remove_recursive(clk_debugfs_root);
+	return err;
+}
+late_initcall(clk_debugfs_init);
+
+#endif /* defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) */
+
arch/arm/plat-samsung/include/plat/clock.h +3 -0
index 0fbcd0e..9a82b88 100644
@@ -47,6 +47,9 @@ struct clk {
 
 	struct clk_ops		*ops;
 	int		    (*enable)(struct clk *, int enable);
+#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
+	struct dentry		*dent;	/* For visible tree hierarchy */
+#endif
 };
 
 /* other clocks which may be registered by board support */
Signature · 1 line
1.6.2.5
#1 lore raw

PATCH v2 1/1 ARM: SAMSUNG: Add support for clock debugging through debug-fs interface

Quoted 2 lines · Amit Daniel Kachhap

This patch adds support for clock information exposed to debug-fs

interface.

Quoted 6 lines

---
Code modified for V2 version are,
a)Inserted the debug-fs code inside macro CONFIG_PM_DEBUG as suggested by yong.shen at linaro.org.

Could you please let me know why?

Quoted 23 lines

b)Removed macro CONFIG_PLAT_SAMSUNG and implemented other coding standards as suggested by kgene.kim at samsung.com

 arch/arm/plat-samsung/clock.c              |   91
++++++++++++++++++++++++++++
 arch/arm/plat-samsung/include/plat/clock.h |    3 +
 2 files changed, 94 insertions(+), 0 deletions(-)
arch/arm/plat-samsung/clock.c +3 -0
index e8d20b0..029a49d 100644
@@ -39,6 +39,9 @@
 #include <linux/clk.h>
 #include <linux/spinlock.h>
 #include <linux/io.h>
+#if defined(CONFIG_DEBUG_FS)
+#include <linux/debugfs.h>
+#endif
 
 #include <mach/hardware.h>
 #include <asm/irq.h>

arch/arm/plat-samsung/clock.c int __init s3c24xx_register_baseclocks(unsigned long · line 453

Quoted 5 lines
arch/arm/plat-samsung/clock.c +1 -0
@@ -447,3 +450,91 @@ int __init s3c24xx_register_baseclocks(unsigned long
 xtal)
 	return 0;
 }
 
+#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)

Hmm...please let me know the reason...

Quoted 4 lines
arch/arm/plat-samsung/clock.c +4 -0
+/* debugfs support to trace clock tree hierarchy and attributes */
+
+static struct dentry *clk_debugfs_root;
+

arch/arm/plat-samsung/clock.c int __init s3c24xx_register_baseclocks(unsigned long xtal) · line 467

Quoted 10 lines
arch/arm/plat-samsung/clock.c +10 -0
+static int clk_debugfs_register_one(struct clk *c)
+{
+	int err;
+	struct dentry *d, *child, *child_tmp;
+	struct clk *pa = c->parent;
+	char s[255];
+	char *p = s;
+
+	p += sprintf(p, "%s", c->name);
+	/*Append id field with name also*/

No need above comment. If required, please add other comments also.

arch/arm/plat-samsung/clock.c int __init s3c24xx_register_baseclocks(unsigned long xtal)

Quoted 10 lines
arch/arm/plat-samsung/clock.c +10 -0
+	if (c->id >= 0)
+		sprintf(p, ":%d", c->id);
+
+	d = debugfs_create_dir(s, pa ? pa->dent : clk_debugfs_root);
+	if (!d)
+		return -ENOMEM;
+
+	c->dent = d;
+
+	d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8

*)&c->usage);

arch/arm/plat-samsung/clock.c int __init s3c24xx_register_baseclocks(unsigned long xtal) · line 481

Quoted 4 lines
arch/arm/plat-samsung/clock.c +4 -0
+	if (!d) {
+		err = -ENOMEM;
+		goto err_out;
+	}

1 empty line would be helpful to read.

arch/arm/plat-samsung/clock.c int __init s3c24xx_register_baseclocks(unsigned long xtal)

Quoted 10 lines
arch/arm/plat-samsung/clock.c +10 -0
+	d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate);
+	if (!d) {
+		err = -ENOMEM;
+		goto err_out;
+	}
+	return 0;
+
+err_out:
+	d = c->dent;
+	list_for_each_entry_safe(child, child_tmp, &d->d_subdirs,

d_u.d_child)

Quoted 39 lines
arch/arm/plat-samsung/clock.c +39 -0
+		debugfs_remove(child);
+	debugfs_remove(c->dent);
+	return err;
+}
+
+static int clk_debugfs_register(struct clk *c)
+{
+	int err;
+	struct clk *pa = c->parent;
+
+	if (pa && !pa->dent) {
+		err = clk_debugfs_register(pa);
+		if (err)
+			return err;
+	}
+
+	if (!c->dent) {
+		err = clk_debugfs_register_one(c);
+		if (err)
+			return err;
+	}
+	return 0;
+}
+
+static int __init clk_debugfs_init(void)
+{
+	struct clk *c;
+	struct dentry *d;
+	int err;
+
+	d = debugfs_create_dir("clock", NULL);
+	if (!d)
+		return -ENOMEM;
+	clk_debugfs_root = d;
+
+	list_for_each_entry(c, &clocks, list) {
+		err = clk_debugfs_register(c);
+		if (err)
+			goto err_out;

arch/arm/plat-samsung/clock.c int __init s3c24xx_register_baseclocks(unsigned long xtal) · line 540

Quoted 10 lines
arch/arm/plat-samsung/clock.c +10 -0
+	}
+	return 0;
+err_out:
+	debugfs_remove_recursive(clk_debugfs_root);
+	return err;
+}
+late_initcall(clk_debugfs_init);
+
+#endif /* defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) */
+

No need last one empty line.

Quoted 6 lines
arch/arm/plat- renamed from arch/arm/plat-samsung/include/plat/clock.h +0 -0

samsung/include/plat/clock.h
index 0fbcd0e..9a82b88 100644

arch/arm/plat-samsung/include/plat/clock.h struct clk {

Quoted 10 lines
arch/arm/plat-samsung/include/plat/clock.h +3 -1
@@ -47,6 +47,9 @@ struct clk {
 
 	struct clk_ops		*ops;
 	int		    (*enable)(struct clk *, int enable);
+#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
+	struct dentry		*dent;	/* For visible tree hierarchy */
+#endif
 };
 
 /* other clocks which may be registered by board support */
--

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#2 lore raw

PATCH v2 1/1 ARM: SAMSUNG: Add support for clock debugging through debug-fs interface

Hi Mr Kim,

Thanks for your comments. Please see the inline comments below.

Quoted 6 lines · Kukjin Kim
Quoted 2 lines · Amit Daniel Kachhap

This patch adds support for clock information exposed to debug-fs

interface.

Quoted 1 line
Quoted 7 lines
Quoted 5 lines

---
Code modified for V2 version are,
a)Inserted the debug-fs code inside macro CONFIG_PM_DEBUG as suggested by yong.shen at linaro.org.

Could you please let me know why?

Actually this patch is mostly taken from omap architecture, so using this macro in addition
to CONFIG_DEBUG_FS macro. Also it is better to enable all PM debugging features with
one configuration parameter.

Quoted 28 lines
Quoted 28 lines

b)Removed macro CONFIG_PLAT_SAMSUNG and implemented other coding standards as suggested by kgene.kim at samsung.com

?arch/arm/plat-samsung/clock.c ? ? ? ? ? ? ?| ? 91
++++++++++++++++++++++++++++
?arch/arm/plat-samsung/include/plat/clock.h | ? ?3 + ?2 files changed, 94 insertions(+), 0 deletions(-)

arch/arm/plat-samsung/clock.c +0 -0
index e8d20b0..029a49d 100644
@@ -39,6 +39,9 @@

?#include <linux/clk.h>
?#include <linux/spinlock.h>
?#include <linux/io.h>

arch/arm/plat-samsung/clock.c +3 -0
+#if defined(CONFIG_DEBUG_FS)
+#include <linux/debugfs.h>
+#endif

?#include <mach/hardware.h>
?#include <asm/irq.h>

arch/arm/plat-samsung/clock.c +0 -0
@@ -447,3 +450,91 @@ int __init s3c24xx_register_baseclocks(unsigned long
 xtal)
 ? ? ? return 0;
 ?}
Quoted 3 lines

arch/arm/plat-samsung/clock.c int __init s3c24xx_register_baseclocks(unsigned long · line 453

Quoted 1 line
arch/arm/plat-samsung/clock.c +1 -0
+#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)

Hmm...please let me know the reason...

same reason as above.

Quoted 17 lines
Quoted 5 lines
arch/arm/plat-samsung/clock.c +4 -0
+/* debugfs support to trace clock tree hierarchy and attributes */
+
+static struct dentry *clk_debugfs_root;
+

arch/arm/plat-samsung/clock.c int __init s3c24xx_register_baseclocks(unsigned long xtal)

Quoted 10 lines
arch/arm/plat-samsung/clock.c +10 -0
+static int clk_debugfs_register_one(struct clk *c)
+{
+ ? ? int err;
+ ? ? struct dentry *d, *child, *child_tmp;
+ ? ? struct clk *pa = c->parent;
+ ? ? char s[255];
+ ? ? char *p = s;
+
+ ? ? p += sprintf(p, "%s", c->name);
+ ? ? /*Append id field with name also*/

No need above comment. If required, please add other comments also.

ok, will remove this comment in next patch.

Quoted 12 lines

arch/arm/plat-samsung/clock.c int __init s3c24xx_register_baseclocks(unsigned long · line 477

Quoted 11 lines
arch/arm/plat-samsung/clock.c +10 -0
+ ? ? if (c->id >= 0)
+ ? ? ? ? ? ? sprintf(p, ":%d", c->id);
+
+ ? ? d = debugfs_create_dir(s, pa ? pa->dent : clk_debugfs_root);
+ ? ? if (!d)
+ ? ? ? ? ? ? return -ENOMEM;
+
+ ? ? c->dent = d;
+
+ ? ? d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8

*)&c->usage);

Quoted 6 lines

arch/arm/plat-samsung/clock.c int __init s3c24xx_register_baseclocks(unsigned long · line 481

Quoted 4 lines
arch/arm/plat-samsung/clock.c +4 -0
+ ? ? if (!d) {
+ ? ? ? ? ? ? err = -ENOMEM;
+ ? ? ? ? ? ? goto err_out;
+ ? ? }

1 empty line would be helpful to read.

ok, will update this in next patch.

Quoted 55 lines

arch/arm/plat-samsung/clock.c int __init s3c24xx_register_baseclocks(unsigned long · line 491

Quoted 11 lines
arch/arm/plat-samsung/clock.c +10 -0
+ ? ? d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate);
+ ? ? if (!d) {
+ ? ? ? ? ? ? err = -ENOMEM;
+ ? ? ? ? ? ? goto err_out;
+ ? ? }
+ ? ? return 0;
+
+err_out:
+ ? ? d = c->dent;
+ ? ? list_for_each_entry_safe(child, child_tmp, &d->d_subdirs,

d_u.d_child)

Quoted 43 lines
arch/arm/plat-samsung/clock.c +43 -0
+ ? ? ? ? ? ? debugfs_remove(child);
+ ? ? debugfs_remove(c->dent);
+ ? ? return err;
+}
+
+static int clk_debugfs_register(struct clk *c)
+{
+ ? ? int err;
+ ? ? struct clk *pa = c->parent;
+
+ ? ? if (pa && !pa->dent) {
+ ? ? ? ? ? ? err = clk_debugfs_register(pa);
+ ? ? ? ? ? ? if (err)
+ ? ? ? ? ? ? ? ? ? ? return err;
+ ? ? }
+
+ ? ? if (!c->dent) {
+ ? ? ? ? ? ? err = clk_debugfs_register_one(c);
+ ? ? ? ? ? ? if (err)
+ ? ? ? ? ? ? ? ? ? ? return err;
+ ? ? }
+ ? ? return 0;
+}
+
+static int __init clk_debugfs_init(void)
+{
+ ? ? struct clk *c;
+ ? ? struct dentry *d;
+ ? ? int err;
+
+ ? ? d = debugfs_create_dir("clock", NULL);
+ ? ? if (!d)
+ ? ? ? ? ? ? return -ENOMEM;
+ ? ? clk_debugfs_root = d;
+
+ ? ? list_for_each_entry(c, &clocks, list) {
+ ? ? ? ? ? ? err = clk_debugfs_register(c);
+ ? ? ? ? ? ? if (err)
+ ? ? ? ? ? ? ? ? ? ? goto err_out;
+ ? ? }
+ ? ? return 0;
+err_out:
+ ? ? debugfs_remove_recursive(clk_debugfs_root);
Quoted 8 lines

arch/arm/plat-samsung/clock.c int __init s3c24xx_register_baseclocks(unsigned long xtal) · line 540

Quoted 6 lines
arch/arm/plat-samsung/clock.c +6 -0
+ ? ? return err;
+}
+late_initcall(clk_debugfs_init);
+
+#endif /* defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) */
+

No need last one empty line.

ok, will update this comment in next patch.

Quoted 27 lines
Quoted 15 lines
arch/arm/plat- renamed from arch/arm/plat-samsung/include/plat/clock.h +0 -0

samsung/include/plat/clock.h
index 0fbcd0e..9a82b88 100644

arch/arm/plat-samsung/include/plat/clock.h +3 -0
@@ -47,6 +47,9 @@ struct clk {
 
 ? ? ? struct clk_ops ? ? ? ? ?*ops;
 ? ? ? int ? ? ? ? ? ? ? ? (*enable)(struct clk *, int enable);
+#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
+ ? ? struct dentry ? ? ? ? ? *dent; ?/* For visible tree hierarchy */
+#endif
 ?};
 
Quoted 2 lines

?/* other clocks which may be registered by board support */ --

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#3 lore raw

PATCH v2 1/1 ARM: SAMSUNG: Add support for clock debugging through debug-fs interface

Quoted 5 lines · Amit Daniel Kachhap

Hi Mr Kim,

Thanks for your comments. Please see the inline comments below.

Hi Amit,

I didn't get your updated patch, but it was small things. So I applied this in my tree for this merge window.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

Quoted 11 lines · Kukjin Kim
Quoted 10 lines
Quoted 2 lines · Amit Daniel Kachhap

This patch adds support for clock information exposed to debug-fs

interface.

Quoted 5 lines

---
Code modified for V2 version are,
a)Inserted the debug-fs code inside macro CONFIG_PM_DEBUG as suggested

by

Quoted 32 lines
Quoted 3 lines
Quoted 1 line

yong.shen at linaro.org.

Could you please let me know why?

Actually this patch is mostly taken from omap architecture, so using this macro in addition
to CONFIG_DEBUG_FS macro. Also it is better to enable all PM debugging features with
one configuration parameter.

Quoted 2 lines
Quoted 2 lines

b)Removed macro CONFIG_PLAT_SAMSUNG and implemented other coding

standards

Quoted 8 lines

arch/arm/plat-

Quoted 8 lines

as suggested by kgene.kim at samsung.com

?arch/arm/plat-samsung/clock.c ? ? ? ? ? ? ?| ? 91
++++++++++++++++++++++++++++
?arch/arm/plat-samsung/include/plat/clock.h | ? ?3 + ?2 files changed, 94 insertions(+), 0 deletions(-)

arch/arm/plat- renamed from arch/arm/plat-samsung/clock.c +0 -0

samsung/clock.c

Quoted 11 lines
Quoted 11 lines

index e8d20b0..029a49d 100644

arch/arm/plat-samsung/clock.c +0 -0
@@ -39,6 +39,9 @@

?#include <linux/clk.h>
?#include <linux/spinlock.h>
?#include <linux/io.h>

arch/arm/plat-samsung/clock.c +3 -0
+#if defined(CONFIG_DEBUG_FS)
+#include <linux/debugfs.h>
+#endif
Quoted 3 lines
Quoted 3 lines

arch/arm/plat-samsung/clock.c int __init s3c24xx_register_baseclocks(unsigned

Quoted 3 lines

?#include <mach/hardware.h>
?#include <asm/irq.h>

arch/arm/plat-samsung/clock.c +0 -0
@@ -447,3 +450,91 @@ int __init s3c24xx_register_baseclocks(unsigned

long

Quoted 38 lines
Quoted 7 lines

arch/arm/plat-samsung/clock.c int __init s3c24xx_register_baseclocks(unsigned

Quoted 5 lines
arch/arm/plat-samsung/clock.c +1 -0
 xtal)
 ? ? ? return 0;
 ?}
 
+#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)

Hmm...please let me know the reason...

same reason as above.

Quoted 17 lines
Quoted 5 lines
arch/arm/plat-samsung/clock.c +4 -0
+/* debugfs support to trace clock tree hierarchy and attributes */
+
+static struct dentry *clk_debugfs_root;
+

arch/arm/plat-samsung/clock.c int __init s3c24xx_register_baseclocks(unsigned long xtal)

Quoted 10 lines
arch/arm/plat-samsung/clock.c +10 -0
+static int clk_debugfs_register_one(struct clk *c)
+{
+ ? ? int err;
+ ? ? struct dentry *d, *child, *child_tmp;
+ ? ? struct clk *pa = c->parent;
+ ? ? char s[255];
+ ? ? char *p = s;
+
+ ? ? p += sprintf(p, "%s", c->name);
+ ? ? /*Append id field with name also*/

No need above comment. If required, please add other comments also.

ok, will remove this comment in next patch.

Quoted 12 lines

arch/arm/plat-samsung/clock.c

Quoted 11 lines

+ ? ? if (c->id >= 0)
+ ? ? ? ? ? ? sprintf(p, ":%d", c->id);

arch/arm/plat-samsung/clock.c +8 -0
+
+ ? ? d = debugfs_create_dir(s, pa ? pa->dent : clk_debugfs_root);
+ ? ? if (!d)
+ ? ? ? ? ? ? return -ENOMEM;
+
+ ? ? c->dent = d;
+
+ ? ? d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8

*)&c->usage);

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines

+ ? ? if (!d) {
+ ? ? ? ? ? ? err = -ENOMEM;
+ ? ? ? ? ? ? goto err_out;
+ ? ? }

1 empty line would be helpful to read.

ok, will update this in next patch.

Quoted 2 lines
Quoted 2 lines

+ ? ? d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32

*)&c->rate);

Quoted 61 lines
Quoted 53 lines

arch/arm/plat-samsung/clock.c int __init s3c24xx_register_baseclocks(unsigned long xtal)

Quoted 9 lines

+ ? ? if (!d) {
+ ? ? ? ? ? ? err = -ENOMEM;
+ ? ? ? ? ? ? goto err_out;
+ ? ? }
+ ? ? return 0;

arch/arm/plat-samsung/clock.c +4 -0
+
+err_out:
+ ? ? d = c->dent;
+ ? ? list_for_each_entry_safe(child, child_tmp, &d->d_subdirs,

d_u.d_child)

Quoted 43 lines

+ ? ? ? ? ? ? debugfs_remove(child);
+ ? ? debugfs_remove(c->dent);
+ ? ? return err;

arch/arm/plat-samsung/clock.c +40 -0
+}
+
+static int clk_debugfs_register(struct clk *c)
+{
+ ? ? int err;
+ ? ? struct clk *pa = c->parent;
+
+ ? ? if (pa && !pa->dent) {
+ ? ? ? ? ? ? err = clk_debugfs_register(pa);
+ ? ? ? ? ? ? if (err)
+ ? ? ? ? ? ? ? ? ? ? return err;
+ ? ? }
+
+ ? ? if (!c->dent) {
+ ? ? ? ? ? ? err = clk_debugfs_register_one(c);
+ ? ? ? ? ? ? if (err)
+ ? ? ? ? ? ? ? ? ? ? return err;
+ ? ? }
+ ? ? return 0;
+}
+
+static int __init clk_debugfs_init(void)
+{
+ ? ? struct clk *c;
+ ? ? struct dentry *d;
+ ? ? int err;
+
+ ? ? d = debugfs_create_dir("clock", NULL);
+ ? ? if (!d)
+ ? ? ? ? ? ? return -ENOMEM;
+ ? ? clk_debugfs_root = d;
+
+ ? ? list_for_each_entry(c, &clocks, list) {
+ ? ? ? ? ? ? err = clk_debugfs_register(c);
+ ? ? ? ? ? ? if (err)
+ ? ? ? ? ? ? ? ? ? ? goto err_out;
+ ? ? }
+ ? ? return 0;
+err_out:
+ ? ? debugfs_remove_recursive(clk_debugfs_root);
Quoted 8 lines

arch/arm/plat-samsung/clock.c int __init s3c24xx_register_baseclocks(unsigned long xtal) · line 540

Quoted 6 lines

+ ? ? return err;

arch/arm/plat-samsung/clock.c +5 -0
+}
+late_initcall(clk_debugfs_init);
+
+#endif /* defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) */
+

No need last one empty line.

Quoted 3 lines

ok, will update this comment in next patch.

Quoted 2 lines

Review

Quoted 2 lines
(quoted diff) +0 -0

b/arch/arm/plat-

Quoted 15 lines
Quoted 15 lines
Quoted 15 lines

samsung/include/plat/clock.h
index 0fbcd0e..9a82b88 100644

arch/arm/plat-samsung/include/plat/clock.h +3 -0
@@ -47,6 +47,9 @@ struct clk {
 
 ? ? ? struct clk_ops ? ? ? ? ?*ops;
 ? ? ? int ? ? ? ? ? ? ? ? (*enable)(struct clk *, int enable);
+#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
+ ? ? struct dentry ? ? ? ? ? *dent; ?/* For visible tree hierarchy */
+#endif
 ?};
 

?/* other clocks which may be registered by board support */ --