]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Declare watchdog functions in watchdog.h
authorSimon Glass <sjg@chromium.org>
Tue, 5 Mar 2013 14:39:42 +0000 (14:39 +0000)
committerTom Rini <trini@ti.com>
Fri, 15 Mar 2013 20:13:59 +0000 (16:13 -0400)
These functions are only available for powerpc and are not declared in a
header file. We want to use the rest function in two places (board_f and
board_r), so declare the functions in watchdog.h.

Signed-off-by: Simon Glass <sjg@chromium.org>
arch/m68k/lib/board.c
arch/powerpc/lib/board.c
arch/sh/lib/board.c
include/watchdog.h

index b676255dd0b5f1b9b4c5c3afb712ac780d9522b8..adaccfe69eee08db5328950b577feebe4bfaa720 100644 (file)
@@ -80,6 +80,7 @@ extern ulong __init_end;
 extern ulong __bss_end;
 
 #if defined(CONFIG_WATCHDOG)
+# undef INIT_FUNC_WATCHDOG_INIT
 # define INIT_FUNC_WATCHDOG_INIT       watchdog_init,
 # define WATCHDOG_DISABLE              watchdog_disable
 
index 0b23d30b8d8146058aa06a55ba234b5e131828c2..acb6fdbf646e301100f353e46fb7e05e3c30d6c9 100644 (file)
@@ -237,25 +237,18 @@ static int init_func_spi(void)
 /***********************************************************************/
 
 #if defined(CONFIG_WATCHDOG)
-static int init_func_watchdog_init(void)
+int init_func_watchdog_init(void)
 {
        puts("       Watchdog enabled\n");
        WATCHDOG_RESET();
        return 0;
 }
 
-#define INIT_FUNC_WATCHDOG_INIT        init_func_watchdog_init,
-
-static int init_func_watchdog_reset(void)
+int init_func_watchdog_reset(void)
 {
        WATCHDOG_RESET();
        return 0;
 }
-
-#define INIT_FUNC_WATCHDOG_RESET       init_func_watchdog_reset,
-#else
-#define INIT_FUNC_WATCHDOG_INIT                /* undef */
-#define INIT_FUNC_WATCHDOG_RESET       /* undef */
 #endif /* CONFIG_WATCHDOG */
 
 /*
index 34d7881f446728d1634cbf3e380c3bdf7c9918cf..6e43acfbd35778165843651f724bf646d368c69c 100644 (file)
@@ -65,6 +65,7 @@ static int sh_flash_init(void)
 #if defined(CONFIG_WATCHDOG)
 extern int watchdog_init(void);
 extern int watchdog_disable(void);
+# undef INIT_FUNC_WATCHDOG_INIT
 # define INIT_FUNC_WATCHDOG_INIT       watchdog_init,
 # define WATCHDOG_DISABLE              watchdog_disable
 #else
index 8c92a0b31beaa2fe52210d7a2dbf2ed22cb28168..97ec186be32e43fa2d40173b57718f1f1bb34eee 100644 (file)
 #ifndef _WATCHDOG_H_
 #define _WATCHDOG_H_
 
+#if !defined(__ASSEMBLY__)
+/*
+ * Reset the watchdog timer, always returns 0
+ *
+ * This function is here since it is shared between board_f() and board_r(),
+ * and the legacy arch/<arch>/board.c code.
+ */
+int init_func_watchdog_reset(void);
+#endif
+
+#ifdef CONFIG_WATCHDOG
+#define INIT_FUNC_WATCHDOG_INIT        init_func_watchdog_init,
+#define INIT_FUNC_WATCHDOG_RESET       init_func_watchdog_reset,
+#else
+#define INIT_FUNC_WATCHDOG_INIT
+#define INIT_FUNC_WATCHDOG_RESET
+#endif
+
 #if defined(CONFIG_HW_WATCHDOG) && defined(CONFIG_WATCHDOG)
 #  error "Configuration error: CONFIG_HW_WATCHDOG and CONFIG_WATCHDOG can't be used together."
 #endif