| ./2621-rc6-remove-board-clocks.patch
|
| Remove the clock initialisation out of s3c24xx_board as very
| few items use this. We intend to remove s3c24xx_board in the
| next release, so this patch forms the first part of this prcoess
|
| Files affected:
|   arch/arm/mach-s3c2410/mach-bast.c    |    4 	2 +	2 -	0 !
|   arch/arm/mach-s3c2410/mach-vr1000.c  |    4 	2 +	2 -	0 !
|   arch/arm/mach-s3c2440/mach-anubis.c  |    4 	2 +	2 -	0 !
|   arch/arm/mach-s3c2440/mach-osiris.c  |    4 	2 +	2 -	0 !
|   arch/arm/plat-s3c24xx/clock.c        |   12 	12 +	0 -	0 !
|   arch/arm/plat-s3c24xx/cpu.c          |    9 	0 +	9 -	0 !
|   include/asm-arm/plat-s3c24xx/clock.h |    1 	1 +	0 -	0 !
|   include/asm-arm/plat-s3c24xx/cpu.h   |    3 	0 +	3 -	0 !
|   8 files changed, 21 insertions(+), 20 deletions(-)
|
| Ben Dooks, Fri, 20 Apr 2007 10:43:15 +0100
|
| Signed-off-by: Ben Dooks <ben-linux@fluff.org>

diff -urpN -X linux-2.6.21-rc6/Documentation/dontdiff linux-2.6.21-rc6/include/asm-arm/plat-s3c24xx/clock.h linux-2.6.21-rc6-noboard2/include/asm-arm/plat-s3c24xx/clock.h
--- linux-2.6.21-rc6/include/asm-arm/plat-s3c24xx/clock.h	2007-04-09 10:08:07.000000000 +0100
+++ linux-2.6.21-rc6-noboard2/include/asm-arm/plat-s3c24xx/clock.h	2007-04-09 10:29:48.000000000 +0100
@@ -56,6 +56,7 @@ extern struct mutex clocks_mutex;
 extern int s3c2410_clkcon_enable(struct clk *clk, int enable);
 
 extern int s3c24xx_register_clock(struct clk *clk);
+extern int s3c24xx_register_clocks(struct clk **clk, int nr_clks);
 
 extern int s3c24xx_setup_clocks(unsigned long xtal,
 				unsigned long fclk,
diff -urpN -X linux-2.6.21-rc6/Documentation/dontdiff linux-2.6.21-rc6/include/asm-arm/plat-s3c24xx/cpu.h linux-2.6.21-rc6-noboard2/include/asm-arm/plat-s3c24xx/cpu.h
--- linux-2.6.21-rc6/include/asm-arm/plat-s3c24xx/cpu.h	2007-04-09 10:08:07.000000000 +0100
+++ linux-2.6.21-rc6-noboard2/include/asm-arm/plat-s3c24xx/cpu.h	2007-04-09 10:29:34.000000000 +0100
@@ -49,9 +49,6 @@ extern void s3c24xx_init_uartdevs(char *
 struct s3c24xx_board {
 	struct platform_device  **devices;
 	unsigned int              devices_count;
-
-	struct clk		**clocks;
-	unsigned int		  clocks_count;
 };
 
 extern void s3c24xx_set_board(struct s3c24xx_board *board);
diff -urpN -X linux-2.6.21-rc6/Documentation/dontdiff linux-2.6.21-rc6/arch/arm/mach-s3c2410/mach-bast.c linux-2.6.21-rc6-noboard2/arch/arm/mach-s3c2410/mach-bast.c
--- linux-2.6.21-rc6/arch/arm/mach-s3c2410/mach-bast.c	2007-04-09 10:08:04.000000000 +0100
+++ linux-2.6.21-rc6-noboard2/arch/arm/mach-s3c2410/mach-bast.c	2007-04-09 10:31:37.000000000 +0100
@@ -467,8 +467,6 @@ static struct clk *bast_clocks[] = {
 static struct s3c24xx_board bast_board __initdata = {
 	.devices       = bast_devices,
 	.devices_count = ARRAY_SIZE(bast_devices),
-	.clocks	       = bast_clocks,
-	.clocks_count  = ARRAY_SIZE(bast_clocks),
 };
 
 static void __init bast_map_io(void)
@@ -486,6 +484,8 @@ static void __init bast_map_io(void)
 
 	s3c24xx_uclk.parent  = &s3c24xx_clkout1;
 
+	s3c24xx_register_clocks(bast_clocks, ARRAY_SIZE(bast_clocks));
+
 	s3c_device_nand.dev.platform_data = &bast_nand_info;
 	s3c_device_i2c.dev.platform_data = &bast_i2c_info;
 
diff -urpN -X linux-2.6.21-rc6/Documentation/dontdiff linux-2.6.21-rc6/arch/arm/mach-s3c2410/mach-vr1000.c linux-2.6.21-rc6-noboard2/arch/arm/mach-s3c2410/mach-vr1000.c
--- linux-2.6.21-rc6/arch/arm/mach-s3c2410/mach-vr1000.c	2007-04-09 10:08:04.000000000 +0100
+++ linux-2.6.21-rc6-noboard2/arch/arm/mach-s3c2410/mach-vr1000.c	2007-04-09 10:32:12.000000000 +0100
@@ -387,8 +387,6 @@ static struct clk *vr1000_clocks[] = {
 static struct s3c24xx_board vr1000_board __initdata = {
 	.devices       = vr1000_devices,
 	.devices_count = ARRAY_SIZE(vr1000_devices),
-	.clocks	       = vr1000_clocks,
-	.clocks_count  = ARRAY_SIZE(vr1000_clocks),
 };
 
 static void vr1000_power_off(void)
@@ -412,6 +410,8 @@ static void __init vr1000_map_io(void)
 
 	s3c24xx_uclk.parent  = &s3c24xx_clkout1;
 
+	s3c24xx_register_clocks(vr1000_clocks, ARRAY_SIZE(vr1000_clocks));
+
 	pm_power_off = vr1000_power_off;
 
 	s3c24xx_init_io(vr1000_iodesc, ARRAY_SIZE(vr1000_iodesc));
diff -urpN -X linux-2.6.21-rc6/Documentation/dontdiff linux-2.6.21-rc6/arch/arm/mach-s3c2440/mach-anubis.c linux-2.6.21-rc6-noboard2/arch/arm/mach-s3c2440/mach-anubis.c
--- linux-2.6.21-rc6/arch/arm/mach-s3c2440/mach-anubis.c	2007-04-09 10:08:04.000000000 +0100
+++ linux-2.6.21-rc6-noboard2/arch/arm/mach-s3c2440/mach-anubis.c	2007-04-09 10:32:50.000000000 +0100
@@ -284,8 +284,6 @@ static struct clk *anubis_clocks[] = {
 static struct s3c24xx_board anubis_board __initdata = {
 	.devices       = anubis_devices,
 	.devices_count = ARRAY_SIZE(anubis_devices),
-	.clocks	       = anubis_clocks,
-	.clocks_count  = ARRAY_SIZE(anubis_clocks),
 };
 
 static void __init anubis_map_io(void)
@@ -303,6 +301,8 @@ static void __init anubis_map_io(void)
 
 	s3c24xx_uclk.parent  = &s3c24xx_clkout1;
 
+	s3c24xx_register_clocks(anubis_clocks, ARRAY_SIZE(anubis_clocks));
+
 	s3c_device_nand.dev.platform_data = &anubis_nand_info;
 
 	s3c24xx_init_io(anubis_iodesc, ARRAY_SIZE(anubis_iodesc));
diff -urpN -X linux-2.6.21-rc6/Documentation/dontdiff linux-2.6.21-rc6/arch/arm/mach-s3c2440/mach-osiris.c linux-2.6.21-rc6-noboard2/arch/arm/mach-s3c2440/mach-osiris.c
--- linux-2.6.21-rc6/arch/arm/mach-s3c2440/mach-osiris.c	2007-04-09 10:08:04.000000000 +0100
+++ linux-2.6.21-rc6-noboard2/arch/arm/mach-s3c2440/mach-osiris.c	2007-04-09 10:33:32.000000000 +0100
@@ -254,8 +254,6 @@ static struct clk *osiris_clocks[] = {
 static struct s3c24xx_board osiris_board __initdata = {
 	.devices       = osiris_devices,
 	.devices_count = ARRAY_SIZE(osiris_devices),
-	.clocks	       = osiris_clocks,
-	.clocks_count  = ARRAY_SIZE(osiris_clocks),
 };
 
 static void __init osiris_map_io(void)
@@ -275,6 +273,8 @@ static void __init osiris_map_io(void)
 
 	s3c24xx_uclk.parent  = &s3c24xx_clkout1;
 
+	s3c24xx_register_clocks(osiris_clocks, ARRAY_SIZE(osiris_clocks));
+
 	s3c_device_nand.dev.platform_data = &osiris_nand_info;
 
 	s3c24xx_init_io(osiris_iodesc, ARRAY_SIZE(osiris_iodesc));
diff -urpN -X linux-2.6.21-rc6/Documentation/dontdiff linux-2.6.21-rc6/arch/arm/plat-s3c24xx/clock.c linux-2.6.21-rc6-noboard2/arch/arm/plat-s3c24xx/clock.c
--- linux-2.6.21-rc6/arch/arm/plat-s3c24xx/clock.c	2007-04-09 10:08:04.000000000 +0100
+++ linux-2.6.21-rc6-noboard2/arch/arm/plat-s3c24xx/clock.c	2007-04-09 10:35:31.000000000 +0100
@@ -404,6 +404,18 @@ int s3c24xx_register_clock(struct clk *c
 	return 0;
 }
 
+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)
+			fails++;
+	}
+
+	return fails;
+}
+
 /* initalise all the clocks */
 
 int __init s3c24xx_setup_clocks(unsigned long xtal,
diff -urpN -X linux-2.6.21-rc6/Documentation/dontdiff linux-2.6.21-rc6/arch/arm/plat-s3c24xx/cpu.c linux-2.6.21-rc6-noboard2/arch/arm/plat-s3c24xx/cpu.c
--- linux-2.6.21-rc6/arch/arm/plat-s3c24xx/cpu.c	2007-04-09 10:08:04.000000000 +0100
+++ linux-2.6.21-rc6-noboard2/arch/arm/plat-s3c24xx/cpu.c	2007-04-09 10:27:49.000000000 +0100
@@ -187,16 +187,7 @@ static struct s3c24xx_board *board;
 
 void s3c24xx_set_board(struct s3c24xx_board *b)
 {
-	int i;
-
 	board = b;
-
-	if (b->clocks_count != 0) {
-		struct clk **ptr = b->clocks;
-
-		for (i = b->clocks_count; i > 0; i--, ptr++)
-			s3c24xx_register_clock(*ptr);
-	}
 }
 
 /* cpu information */

