ARM: orion: Consolidate the platform data setup for the watchdog.
authorAndrew Lunn <andrew@lunn.ch>
Sun, 15 May 2011 11:32:47 +0000 (13:32 +0200)
committerNicolas Pitre <nico@fluxnic.net>
Mon, 16 May 2011 19:10:03 +0000 (15:10 -0400)
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
arch/arm/mach-kirkwood/common.c
arch/arm/mach-orion5x/common.c
arch/arm/plat-orion/common.c
arch/arm/plat-orion/include/plat/common.h

index af864fc7883b656fa6a3db59e99bd5ab19fabb31..08847a6f7d10ec9641ff380da12b27c630326650 100644 (file)
@@ -29,7 +29,6 @@
 #include <plat/mvsdio.h>
 #include <plat/mv_xor.h>
 #include <plat/orion_nand.h>
-#include <plat/orion_wdt.h>
 #include <plat/common.h>
 #include <plat/time.h>
 #include "common.h"
@@ -575,23 +574,9 @@ static void __init kirkwood_xor1_init(void)
 /*****************************************************************************
  * Watchdog
  ****************************************************************************/
-static struct orion_wdt_platform_data kirkwood_wdt_data = {
-       .tclk           = 0,
-};
-
-static struct platform_device kirkwood_wdt_device = {
-       .name           = "orion_wdt",
-       .id             = -1,
-       .dev            = {
-               .platform_data  = &kirkwood_wdt_data,
-       },
-       .num_resources  = 0,
-};
-
 static void __init kirkwood_wdt_init(void)
 {
-       kirkwood_wdt_data.tclk = kirkwood_tclk;
-       platform_device_register(&kirkwood_wdt_device);
+       orion_wdt_init(kirkwood_tclk);
 }
 
 
index d2dee431635a12d68909be0a7f54192ee6c1eb66..c26e6dbe489b0a55d9c33a86f355000310475a21 100644 (file)
@@ -30,7 +30,6 @@
 #include <plat/ehci-orion.h>
 #include <plat/mv_xor.h>
 #include <plat/orion_nand.h>
-#include <plat/orion_wdt.h>
 #include <plat/time.h>
 #include <plat/common.h>
 #include "common.h"
@@ -380,23 +379,9 @@ static int __init orion5x_crypto_init(void)
 /*****************************************************************************
  * Watchdog
  ****************************************************************************/
-static struct orion_wdt_platform_data orion5x_wdt_data = {
-       .tclk                   = 0,
-};
-
-static struct platform_device orion5x_wdt_device = {
-       .name           = "orion_wdt",
-       .id             = -1,
-       .dev            = {
-               .platform_data  = &orion5x_wdt_data,
-       },
-       .num_resources  = 0,
-};
-
 void __init orion5x_wdt_init(void)
 {
-       orion5x_wdt_data.tclk = orion5x_tclk;
-       platform_device_register(&orion5x_wdt_device);
+       orion_wdt_init(orion5x_tclk);
 }
 
 
index 2afe79d1a273965c3c845eb592fb351fa2ab62c3..65022094747a91dc1d9a1af1cf50eb32e46de197 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/mv643xx_i2c.h>
 #include <net/dsa.h>
 #include <linux/spi/orion_spi.h>
+#include <plat/orion_wdt.h>
 
 /* Fill in the resources structure and link it into the platform
    device structure. There is always a memory region, and nearly
@@ -564,3 +565,23 @@ void __init orion_spi_1_init(unsigned long mapbase,
                       mapbase, SZ_512 - 1, NO_IRQ);
        platform_device_register(&orion_spi_1);
 }
+
+/*****************************************************************************
+ * Watchdog
+ ****************************************************************************/
+static struct orion_wdt_platform_data orion_wdt_data;
+
+static struct platform_device orion_wdt_device = {
+       .name           = "orion_wdt",
+       .id             = -1,
+       .dev            = {
+               .platform_data  = &orion_wdt_data,
+       },
+       .num_resources  = 0,
+};
+
+void __init orion_wdt_init(unsigned long tclk)
+{
+       orion_wdt_data.tclk = tclk;
+       platform_device_register(&orion_wdt_device);
+}
index e72c1466d6ce8987177e100571517f4810e39e5f..38ae4bfd22a4ee7eb0f7f244af0e1d15675c7f9e 100644 (file)
@@ -79,4 +79,6 @@ void __init orion_spi_init(unsigned long mapbase,
 
 void __init orion_spi_1_init(unsigned long mapbase,
                             unsigned long tclk);
+
+void __init orion_wdt_init(unsigned long tclk);
 #endif
This page took 0.033916 seconds and 5 git commands to generate.