Skip to contentSkip to conversation

S3C/SAMSUNG: clock fixes and updates

PATCH New Ben Dooks 1 participant 4 messages Jan 25, 2010

Subsystems (3)
lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

Clock fixes and updates for next-samsung.

author
#1 lore raw

PATCH 1/1 ARM: SAMSUNG: Fix bad use of __initdata for s3c_register_clocks()

Functions should be marked __init, not __initdata.

---
 arch/arm/plat-samsung/clock.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/plat-samsung/clock.c +1 -1
index 0c746ae..e9cdbe4 100644
@@ -344,7 +344,7 @@ int s3c24xx_register_clocks(struct clk **clks, int nr_clks)
  * Call s3c24xx_register_clock() on the @clkp array given, printing an
  * error if it fails to register the clock (unlikely).
  */
-void __initdata s3c_register_clocks(struct clk *clkp, int nr_clks)
+void __init s3c_register_clocks(struct clk *clkp, int nr_clks)
 {
 	int ret;
 
Signature · 1 line
1.6.0.4
author
#2 lore raw

PATCH 1/1 ARM: SAMSUNG: Add documentation to the clock registration calls.

In reply to Ben Dooks

Add some kerneldoc documentation to the s3c24xx_register_clock and the s3c24xx_register_clocks() call.

---
 arch/arm/plat-samsung/clock.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
arch/arm/plat-samsung/clock.c +14 -0
index e9cdbe4..4b95b39 100644
@@ -307,6 +307,12 @@ struct clk s3c24xx_uclk = {
 
 /* initialise the clock system */
 
+/**
+ * s3c24xx_register_clock() - register a clock
+ * @clk: The clock to register
+ *
+ * Add the specified clock to the list of clocks known by the system.
+ */
 int s3c24xx_register_clock(struct clk *clk)
 {
 	if (clk->enable == NULL)
@@ -324,6 +330,14 @@ int s3c24xx_register_clock(struct clk *clk)
 	return 0;
 }
 
+/**
+ * s3c24xx_register_clocks() - register an array of clock pointers
+ * @clks: Pointer to an array of struct clk pointers
+ * @nr_clks: The number of clocks in the @clks array.
+ *
+ * Call s3c24xx_register_clock() for all the clock pointers contained
+ * in the @clks list. Returns the number of failures.
+ */
 int s3c24xx_register_clocks(struct clk **clks, int nr_clks)
 {
 	int fails = 0;
Signature · 1 line
1.6.0.4
author
#3 lore raw

PATCH 1/1 ARM: SAMSUNG: Add error printing to s3c24xx_register_clocks

In reply to Ben Dooks

Add an error print to s3c24xx_register_clocks to provide more useful information when failing to register the clock.

I belive this was originally left out due to the possibility of a problem with low-level debugging code. However, if the low-level debug code is not functional by now there will be a whole other set of problems being presented to the system.

---
 arch/arm/plat-samsung/clock.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
arch/arm/plat-samsung/clock.c +5 -1
index 4b95b39..1b25c9d 100644
@@ -343,8 +343,12 @@ int s3c24xx_register_clocks(struct clk **clks, int nr_clks)
 	int fails = 0;
 
 	for (; nr_clks > 0; nr_clks--, clks++) {
-		if (s3c24xx_register_clock(*clks) < 0)
+		if (s3c24xx_register_clock(*clks) < 0) {
+			struct clk *clk = *clks;
+			printk(KERN_ERR "%s: failed to register %p: %s\n",
+			       __func__, clk, clk->name);
 			fails++;
+		}
 	}
 
 	return fails;
Signature · 1 line
1.6.0.4