Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=726c9f611a4079b5265e7ede1d66ed455ac6343c
Commit:     726c9f611a4079b5265e7ede1d66ed455ac6343c
Parent:     c0ead7e0ff996f0cfa91a73fa674fdca5c05798a
Author:     Wim Van Sebroeck <[EMAIL PROTECTED]>
AuthorDate: Mon Jun 18 22:49:35 2007 +0200
Committer:  Wim Van Sebroeck <[EMAIL PROTECTED]>
CommitDate: Thu Jul 5 05:31:27 2007 +0000

    [WATCHDOG] at32ap700x_wdt.c - timeout module parameter patch
    
    integrate the timeout/heartbeat as a module parameter and not as
    a CONFIG_* value.
    
    Signed-off-by: Hans-Christian Egtvedt <[EMAIL PROTECTED]>
    Cc: Haavard Skinnemoen <[EMAIL PROTECTED]>
    Signed-off-by: Wim Van Sebroeck <[EMAIL PROTECTED]>
    Cc: Andrew Morton <[EMAIL PROTECTED]>
---
 drivers/char/watchdog/Kconfig          |   11 -----------
 drivers/char/watchdog/at32ap700x_wdt.c |   18 +++++++++++++-----
 2 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/drivers/char/watchdog/Kconfig b/drivers/char/watchdog/Kconfig
index 520afb8..2f48ba3 100644
--- a/drivers/char/watchdog/Kconfig
+++ b/drivers/char/watchdog/Kconfig
@@ -196,17 +196,6 @@ config AT32AP700X_WDT
          Watchdog timer embedded into AT32AP700x devices. This will reboot
          your system when the timeout is reached.
 
-config AT32AP700X_WDT_TIMEOUT
-       int "Timeout value for AT32AP700x watchdog"
-       depends on AT32AP700X_WDT
-       default "2"
-       range 1 2
-       help
-         Sets the timeout value for the watchdog in AT32AP700x devices.
-         Limited by hardware to be 1 or 2 seconds.
-
-         Set to 2 seconds by default.
-
 # X86 (i386 + ia64 + x86_64) Architecture
 
 config ACQUIRE_WDT
diff --git a/drivers/char/watchdog/at32ap700x_wdt.c 
b/drivers/char/watchdog/at32ap700x_wdt.c
index 8abe1c7..6e7c958 100644
--- a/drivers/char/watchdog/at32ap700x_wdt.c
+++ b/drivers/char/watchdog/at32ap700x_wdt.c
@@ -20,8 +20,15 @@
 #include <linux/io.h>
 
 #define TIMEOUT_MIN            1
-#define TIMEOUT_DEFAULT                CONFIG_AT32AP700X_WDT_TIMEOUT
 #define TIMEOUT_MAX            2
+#define TIMEOUT_DEFAULT                TIMEOUT_MAX
+
+/* module parameters */
+static int timeout =  TIMEOUT_DEFAULT;
+module_param(timeout, int, 0);
+MODULE_PARM_DESC(timeout,
+               "Timeout value. Limited to be 1 or 2 seconds. (default="
+               __MODULE_STRING(TIMEOUT_DEFAULT) ")");
 
 /* Watchdog registers and write/read macro */
 #define WDT_CTRL               0x00
@@ -233,11 +240,11 @@ static int __init at32_wdt_probe(struct platform_device 
*pdev)
        wdt->miscdev.name = "watchdog";
        wdt->miscdev.fops = &at32_wdt_fops;
 
-       if (at32_wdt_settimeout(TIMEOUT_DEFAULT)) {
-               at32_wdt_settimeout(TIMEOUT_MAX);
+       if (at32_wdt_settimeout(timeout)) {
+               at32_wdt_settimeout(TIMEOUT_DEFAULT);
                dev_dbg(&pdev->dev,
                        "default timeout invalid, set to %d sec.\n",
-                       TIMEOUT_MAX);
+                       TIMEOUT_DEFAULT);
        }
 
        ret = misc_register(&wdt->miscdev);
@@ -248,7 +255,8 @@ static int __init at32_wdt_probe(struct platform_device 
*pdev)
 
        platform_set_drvdata(pdev, wdt);
        wdt->miscdev.parent = &pdev->dev;
-       dev_info(&pdev->dev, "AT32AP700X WDT at 0x%p\n", wdt->regs);
+       dev_info(&pdev->dev, "AT32AP700X WDT at 0x%p, timeout %d sec\n",
+               wdt->regs, wdt->timeout);
 
        return 0;
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to