Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296774
b: refs/heads/master
c: 27c766a
h: refs/heads/master
v: v3
  • Loading branch information
Joe Perches authored and Wim Van Sebroeck committed Mar 27, 2012
1 parent 5073f92 commit 02315ad
Show file tree
Hide file tree
Showing 91 changed files with 1,040 additions and 1,281 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7cbc353540c31ffaf65ad44d89b955be0f1d04dc
refs/heads/master: 27c766aaacb265d625dc634bf7903f7f9fd0c697
24 changes: 10 additions & 14 deletions trunk/drivers/watchdog/acquirewdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
* Includes, defines, variables, module parameters, ...
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

/* Includes */
#include <linux/module.h> /* For module specific items */
#include <linux/moduleparam.h> /* For new moduleparam's */
Expand All @@ -70,7 +72,6 @@

/* Module information */
#define DRV_NAME "acquirewdt"
#define PFX DRV_NAME ": "
#define WATCHDOG_NAME "Acquire WDT"
/* There is no way to see what the correct time-out period is */
#define WATCHDOG_HEARTBEAT 0
Expand Down Expand Up @@ -208,8 +209,7 @@ static int acq_close(struct inode *inode, struct file *file)
if (expect_close == 42) {
acq_stop();
} else {
printk(KERN_CRIT PFX
"Unexpected close, not stopping watchdog!\n");
pr_crit("Unexpected close, not stopping watchdog!\n");
acq_keepalive();
}
clear_bit(0, &acq_is_open);
Expand Down Expand Up @@ -246,27 +246,24 @@ static int __devinit acq_probe(struct platform_device *dev)

if (wdt_stop != wdt_start) {
if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) {
printk(KERN_ERR PFX
"I/O address 0x%04x already in use\n", wdt_stop);
pr_err("I/O address 0x%04x already in use\n", wdt_stop);
ret = -EIO;
goto out;
}
}

if (!request_region(wdt_start, 1, WATCHDOG_NAME)) {
printk(KERN_ERR PFX "I/O address 0x%04x already in use\n",
wdt_start);
pr_err("I/O address 0x%04x already in use\n", wdt_start);
ret = -EIO;
goto unreg_stop;
}
ret = misc_register(&acq_miscdev);
if (ret != 0) {
printk(KERN_ERR PFX
"cannot register miscdev on minor=%d (err=%d)\n",
WATCHDOG_MINOR, ret);
pr_err("cannot register miscdev on minor=%d (err=%d)\n",
WATCHDOG_MINOR, ret);
goto unreg_regions;
}
printk(KERN_INFO PFX "initialized. (nowayout=%d)\n", nowayout);
pr_info("initialized. (nowayout=%d)\n", nowayout);

return 0;
unreg_regions:
Expand Down Expand Up @@ -308,8 +305,7 @@ static int __init acq_init(void)
{
int err;

printk(KERN_INFO
"WDT driver for Acquire single board computer initialising.\n");
pr_info("WDT driver for Acquire single board computer initialising\n");

err = platform_driver_register(&acquirewdt_driver);
if (err)
Expand All @@ -332,7 +328,7 @@ static void __exit acq_exit(void)
{
platform_device_unregister(acq_platform_device);
platform_driver_unregister(&acquirewdt_driver);
printk(KERN_INFO PFX "Watchdog Module Unloaded.\n");
pr_info("Watchdog Module Unloaded\n");
}

module_init(acq_init);
Expand Down
30 changes: 12 additions & 18 deletions trunk/drivers/watchdog/advantechwdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
* add wdt_start and wdt_stop as parameters.
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
Expand All @@ -43,7 +45,6 @@
#include <asm/system.h>

#define DRV_NAME "advantechwdt"
#define PFX DRV_NAME ": "
#define WATCHDOG_NAME "Advantech WDT"
#define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */

Expand Down Expand Up @@ -207,8 +208,7 @@ static int advwdt_close(struct inode *inode, struct file *file)
if (adv_expect_close == 42) {
advwdt_disable();
} else {
printk(KERN_CRIT PFX
"Unexpected close, not stopping watchdog!\n");
pr_crit("Unexpected close, not stopping watchdog!\n");
advwdt_ping();
}
clear_bit(0, &advwdt_is_open);
Expand Down Expand Up @@ -245,18 +245,15 @@ static int __devinit advwdt_probe(struct platform_device *dev)

if (wdt_stop != wdt_start) {
if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) {
printk(KERN_ERR PFX
"I/O address 0x%04x already in use\n",
wdt_stop);
pr_err("I/O address 0x%04x already in use\n",
wdt_stop);
ret = -EIO;
goto out;
}
}

if (!request_region(wdt_start, 1, WATCHDOG_NAME)) {
printk(KERN_ERR PFX
"I/O address 0x%04x already in use\n",
wdt_start);
pr_err("I/O address 0x%04x already in use\n", wdt_start);
ret = -EIO;
goto unreg_stop;
}
Expand All @@ -265,18 +262,16 @@ static int __devinit advwdt_probe(struct platform_device *dev)
* if not reset to the default */
if (advwdt_set_heartbeat(timeout)) {
advwdt_set_heartbeat(WATCHDOG_TIMEOUT);
printk(KERN_INFO PFX
"timeout value must be 1<=x<=63, using %d\n", timeout);
pr_info("timeout value must be 1<=x<=63, using %d\n", timeout);
}

ret = misc_register(&advwdt_miscdev);
if (ret != 0) {
printk(KERN_ERR PFX
"cannot register miscdev on minor=%d (err=%d)\n",
WATCHDOG_MINOR, ret);
pr_err("cannot register miscdev on minor=%d (err=%d)\n",
WATCHDOG_MINOR, ret);
goto unreg_regions;
}
printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n",
pr_info("initialized. timeout=%d sec (nowayout=%d)\n",
timeout, nowayout);
out:
return ret;
Expand Down Expand Up @@ -318,8 +313,7 @@ static int __init advwdt_init(void)
{
int err;

printk(KERN_INFO
"WDT driver for Advantech single board computer initialising.\n");
pr_info("WDT driver for Advantech single board computer initialising\n");

err = platform_driver_register(&advwdt_driver);
if (err)
Expand All @@ -343,7 +337,7 @@ static void __exit advwdt_exit(void)
{
platform_device_unregister(advwdt_platform_device);
platform_driver_unregister(&advwdt_driver);
printk(KERN_INFO PFX "Watchdog Module Unloaded.\n");
pr_info("Watchdog Module Unloaded\n");
}

module_init(advwdt_init);
Expand Down
21 changes: 9 additions & 12 deletions trunk/drivers/watchdog/alim1535_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* 2 of the License, or (at your option) any later version.
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
Expand All @@ -22,7 +24,6 @@
#include <linux/io.h>

#define WATCHDOG_NAME "ALi_M1535"
#define PFX WATCHDOG_NAME ": "
#define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */

/* internal variables */
Expand Down Expand Up @@ -268,8 +269,7 @@ static int ali_release(struct inode *inode, struct file *file)
if (ali_expect_release == 42)
ali_stop();
else {
printk(KERN_CRIT PFX
"Unexpected close, not stopping watchdog!\n");
pr_crit("Unexpected close, not stopping watchdog!\n");
ali_keepalive();
}
clear_bit(0, &ali_is_open);
Expand Down Expand Up @@ -399,30 +399,27 @@ static int __init watchdog_init(void)
if not reset to the default */
if (timeout < 1 || timeout >= 18000) {
timeout = WATCHDOG_TIMEOUT;
printk(KERN_INFO PFX
"timeout value must be 0 < timeout < 18000, using %d\n",
timeout);
pr_info("timeout value must be 0 < timeout < 18000, using %d\n",
timeout);
}

/* Calculate the watchdog's timeout */
ali_settimer(timeout);

ret = register_reboot_notifier(&ali_notifier);
if (ret != 0) {
printk(KERN_ERR PFX
"cannot register reboot notifier (err=%d)\n", ret);
pr_err("cannot register reboot notifier (err=%d)\n", ret);
goto out;
}

ret = misc_register(&ali_miscdev);
if (ret != 0) {
printk(KERN_ERR PFX
"cannot register miscdev on minor=%d (err=%d)\n",
WATCHDOG_MINOR, ret);
pr_err("cannot register miscdev on minor=%d (err=%d)\n",
WATCHDOG_MINOR, ret);
goto unreg_reboot;
}

printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n",
pr_info("initialized. timeout=%d sec (nowayout=%d)\n",
timeout, nowayout);

out:
Expand Down
51 changes: 18 additions & 33 deletions trunk/drivers/watchdog/alim7101_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* -- Mike Waychison <michael.waychison@sun.com>
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
Expand All @@ -36,9 +38,6 @@

#include <asm/system.h>

#define OUR_NAME "alim7101_wdt"
#define PFX OUR_NAME ": "

#define WDT_ENABLE 0x9C
#define WDT_DISABLE 0x8C

Expand Down Expand Up @@ -112,8 +111,7 @@ static void wdt_timer_ping(unsigned long data)
ALI_7101_GPIO_O, tmp & ~0x20);
}
} else {
printk(KERN_WARNING PFX
"Heartbeat lost! Will not ping the watchdog\n");
pr_warn("Heartbeat lost! Will not ping the watchdog\n");
}
/* Re-set the timer interval */
mod_timer(&timer, jiffies + WDT_INTERVAL);
Expand Down Expand Up @@ -162,15 +160,15 @@ static void wdt_startup(void)
/* Start the timer */
mod_timer(&timer, jiffies + WDT_INTERVAL);

printk(KERN_INFO PFX "Watchdog timer is now enabled.\n");
pr_info("Watchdog timer is now enabled\n");
}

static void wdt_turnoff(void)
{
/* Stop the timer */
del_timer_sync(&timer);
wdt_change(WDT_DISABLE);
printk(KERN_INFO PFX "Watchdog timer is now disabled...\n");
pr_info("Watchdog timer is now disabled...\n");
}

static void wdt_keepalive(void)
Expand Down Expand Up @@ -226,8 +224,7 @@ static int fop_close(struct inode *inode, struct file *file)
wdt_turnoff();
else {
/* wim: shouldn't there be a: del_timer(&timer); */
printk(KERN_CRIT PFX
"device file closed unexpectedly. Will not stop the WDT!\n");
pr_crit("device file closed unexpectedly. Will not stop the WDT!\n");
}
clear_bit(0, &wdt_is_open);
wdt_expect_close = 0;
Expand Down Expand Up @@ -322,8 +319,7 @@ static int wdt_notify_sys(struct notifier_block *this,
* watchdog on reboot with no heartbeat
*/
wdt_change(WDT_ENABLE);
printk(KERN_INFO PFX "Watchdog timer is now enabled "
"with no heartbeat - should reboot in ~1 second.\n");
pr_info("Watchdog timer is now enabled with no heartbeat - should reboot in ~1 second\n");
}
return NOTIFY_DONE;
}
Expand Down Expand Up @@ -352,12 +348,11 @@ static int __init alim7101_wdt_init(void)
struct pci_dev *ali1543_south;
char tmp;

printk(KERN_INFO PFX "Steve Hill <steve@navaho.co.uk>.\n");
pr_info("Steve Hill <steve@navaho.co.uk>\n");
alim7101_pmu = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101,
NULL);
if (!alim7101_pmu) {
printk(KERN_INFO PFX
"ALi M7101 PMU not present - WDT not set\n");
pr_info("ALi M7101 PMU not present - WDT not set\n");
return -EBUSY;
}

Expand All @@ -367,56 +362,46 @@ static int __init alim7101_wdt_init(void)
ali1543_south = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533,
NULL);
if (!ali1543_south) {
printk(KERN_INFO PFX
"ALi 1543 South-Bridge not present - WDT not set\n");
pr_info("ALi 1543 South-Bridge not present - WDT not set\n");
goto err_out;
}
pci_read_config_byte(ali1543_south, 0x5e, &tmp);
pci_dev_put(ali1543_south);
if ((tmp & 0x1e) == 0x00) {
if (!use_gpio) {
printk(KERN_INFO PFX
"Detected old alim7101 revision 'a1d'. "
"If this is a cobalt board, set the 'use_gpio' "
"module parameter.\n");
pr_info("Detected old alim7101 revision 'a1d'. If this is a cobalt board, set the 'use_gpio' module parameter.\n");
goto err_out;
}
nowayout = 1;
} else if ((tmp & 0x1e) != 0x12 && (tmp & 0x1e) != 0x00) {
printk(KERN_INFO PFX
"ALi 1543 South-Bridge does not have the correct "
"revision number (???1001?) - WDT not set\n");
pr_info("ALi 1543 South-Bridge does not have the correct revision number (???1001?) - WDT not set\n");
goto err_out;
}

if (timeout < 1 || timeout > 3600) {
/* arbitrary upper limit */
timeout = WATCHDOG_TIMEOUT;
printk(KERN_INFO PFX
"timeout value must be 1 <= x <= 3600, using %d\n",
timeout);
pr_info("timeout value must be 1 <= x <= 3600, using %d\n",
timeout);
}

rc = register_reboot_notifier(&wdt_notifier);
if (rc) {
printk(KERN_ERR PFX
"cannot register reboot notifier (err=%d)\n", rc);
pr_err("cannot register reboot notifier (err=%d)\n", rc);
goto err_out;
}

rc = misc_register(&wdt_miscdev);
if (rc) {
printk(KERN_ERR PFX
"cannot register miscdev on minor=%d (err=%d)\n",
wdt_miscdev.minor, rc);
pr_err("cannot register miscdev on minor=%d (err=%d)\n",
wdt_miscdev.minor, rc);
goto err_out_reboot;
}

if (nowayout)
__module_get(THIS_MODULE);

printk(KERN_INFO PFX "WDT driver for ALi M7101 initialised. "
"timeout=%d sec (nowayout=%d)\n",
pr_info("WDT driver for ALi M7101 initialised. timeout=%d sec (nowayout=%d)\n",
timeout, nowayout);
return 0;

Expand Down
Loading

0 comments on commit 02315ad

Please sign in to comment.