mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
watchdog: Use pr_<fmt> and pr_<level>
Use the current logging styles. Make sure all output has a prefix. Add missing newlines. Remove now unnecessary PFX, NAME, and miscellaneous other #defines. Coalesce formats. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
This commit is contained in:
committed by
Wim Van Sebroeck
parent
7cbc353540
commit
27c766aaac
@@ -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 */
|
||||
@@ -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
|
||||
@@ -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);
|
||||
@@ -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:
|
||||
@@ -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)
|
||||
@@ -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);
|
||||
|
||||
@@ -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>
|
||||
@@ -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 */
|
||||
|
||||
@@ -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);
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
@@ -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)
|
||||
@@ -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);
|
||||
|
||||
@@ -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>
|
||||
@@ -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 */
|
||||
@@ -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);
|
||||
@@ -399,9 +399,8 @@ 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 */
|
||||
@@ -409,20 +408,18 @@ static int __init watchdog_init(void)
|
||||
|
||||
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:
|
||||
|
||||
@@ -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>
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
@@ -162,7 +160,7 @@ 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)
|
||||
@@ -170,7 +168,7 @@ 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)
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
+16
-18
@@ -23,6 +23,8 @@
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <linux/errno.h>
|
||||
@@ -39,7 +41,6 @@
|
||||
#include <asm/addrspace.h>
|
||||
#include <asm/mach-ar7/ar7.h>
|
||||
|
||||
#define DRVNAME "ar7_wdt"
|
||||
#define LONGNAME "TI AR7 Watchdog Timer"
|
||||
|
||||
MODULE_AUTHOR("Nicolas Thill <nico@openwrt.org>");
|
||||
@@ -93,7 +94,7 @@ static void ar7_wdt_kick(u32 value)
|
||||
return;
|
||||
}
|
||||
}
|
||||
printk(KERN_ERR DRVNAME ": failed to unlock WDT kick reg\n");
|
||||
pr_err("failed to unlock WDT kick reg\n");
|
||||
}
|
||||
|
||||
static void ar7_wdt_prescale(u32 value)
|
||||
@@ -106,7 +107,7 @@ static void ar7_wdt_prescale(u32 value)
|
||||
return;
|
||||
}
|
||||
}
|
||||
printk(KERN_ERR DRVNAME ": failed to unlock WDT prescale reg\n");
|
||||
pr_err("failed to unlock WDT prescale reg\n");
|
||||
}
|
||||
|
||||
static void ar7_wdt_change(u32 value)
|
||||
@@ -119,7 +120,7 @@ static void ar7_wdt_change(u32 value)
|
||||
return;
|
||||
}
|
||||
}
|
||||
printk(KERN_ERR DRVNAME ": failed to unlock WDT change reg\n");
|
||||
pr_err("failed to unlock WDT change reg\n");
|
||||
}
|
||||
|
||||
static void ar7_wdt_disable(u32 value)
|
||||
@@ -135,7 +136,7 @@ static void ar7_wdt_disable(u32 value)
|
||||
}
|
||||
}
|
||||
}
|
||||
printk(KERN_ERR DRVNAME ": failed to unlock WDT disable reg\n");
|
||||
pr_err("failed to unlock WDT disable reg\n");
|
||||
}
|
||||
|
||||
static void ar7_wdt_update_margin(int new_margin)
|
||||
@@ -151,21 +152,20 @@ static void ar7_wdt_update_margin(int new_margin)
|
||||
change = 0xffff;
|
||||
ar7_wdt_change(change);
|
||||
margin = change * prescale_value / vbus_rate;
|
||||
printk(KERN_INFO DRVNAME
|
||||
": timer margin %d seconds (prescale %d, change %d, freq %d)\n",
|
||||
margin, prescale_value, change, vbus_rate);
|
||||
pr_info("timer margin %d seconds (prescale %d, change %d, freq %d)\n",
|
||||
margin, prescale_value, change, vbus_rate);
|
||||
}
|
||||
|
||||
static void ar7_wdt_enable_wdt(void)
|
||||
{
|
||||
printk(KERN_DEBUG DRVNAME ": enabling watchdog timer\n");
|
||||
pr_debug("enabling watchdog timer\n");
|
||||
ar7_wdt_disable(1);
|
||||
ar7_wdt_kick(1);
|
||||
}
|
||||
|
||||
static void ar7_wdt_disable_wdt(void)
|
||||
{
|
||||
printk(KERN_DEBUG DRVNAME ": disabling watchdog timer\n");
|
||||
pr_debug("disabling watchdog timer\n");
|
||||
ar7_wdt_disable(0);
|
||||
}
|
||||
|
||||
@@ -183,9 +183,7 @@ static int ar7_wdt_open(struct inode *inode, struct file *file)
|
||||
static int ar7_wdt_release(struct inode *inode, struct file *file)
|
||||
{
|
||||
if (!expect_close)
|
||||
printk(KERN_WARNING DRVNAME
|
||||
": watchdog device closed unexpectedly,"
|
||||
"will not disable the watchdog timer\n");
|
||||
pr_warn("watchdog device closed unexpectedly, will not disable the watchdog timer\n");
|
||||
else if (!nowayout)
|
||||
ar7_wdt_disable_wdt();
|
||||
clear_bit(0, &wdt_is_open);
|
||||
@@ -283,28 +281,28 @@ static int __devinit ar7_wdt_probe(struct platform_device *pdev)
|
||||
ar7_regs_wdt =
|
||||
platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
|
||||
if (!ar7_regs_wdt) {
|
||||
printk(KERN_ERR DRVNAME ": could not get registers resource\n");
|
||||
pr_err("could not get registers resource\n");
|
||||
rc = -ENODEV;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!request_mem_region(ar7_regs_wdt->start,
|
||||
resource_size(ar7_regs_wdt), LONGNAME)) {
|
||||
printk(KERN_WARNING DRVNAME ": watchdog I/O region busy\n");
|
||||
pr_warn("watchdog I/O region busy\n");
|
||||
rc = -EBUSY;
|
||||
goto out;
|
||||
}
|
||||
|
||||
ar7_wdt = ioremap(ar7_regs_wdt->start, resource_size(ar7_regs_wdt));
|
||||
if (!ar7_wdt) {
|
||||
printk(KERN_ERR DRVNAME ": could not ioremap registers\n");
|
||||
pr_err("could not ioremap registers\n");
|
||||
rc = -ENXIO;
|
||||
goto out_mem_region;
|
||||
}
|
||||
|
||||
vbus_clk = clk_get(NULL, "vbus");
|
||||
if (IS_ERR(vbus_clk)) {
|
||||
printk(KERN_ERR DRVNAME ": could not get vbus clock\n");
|
||||
pr_err("could not get vbus clock\n");
|
||||
rc = PTR_ERR(vbus_clk);
|
||||
goto out_mem_region;
|
||||
}
|
||||
@@ -315,7 +313,7 @@ static int __devinit ar7_wdt_probe(struct platform_device *pdev)
|
||||
|
||||
rc = misc_register(&ar7_wdt_miscdev);
|
||||
if (rc) {
|
||||
printk(KERN_ERR DRVNAME ": unable to register misc device\n");
|
||||
pr_err("unable to register misc device\n");
|
||||
goto out_alloc;
|
||||
}
|
||||
goto out;
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/fs.h>
|
||||
@@ -209,8 +211,8 @@ static int __devinit at91wdt_probe(struct platform_device *pdev)
|
||||
if (res)
|
||||
return res;
|
||||
|
||||
printk(KERN_INFO "AT91 Watchdog Timer enabled (%d seconds%s)\n",
|
||||
wdt_time, nowayout ? ", nowayout" : "");
|
||||
pr_info("AT91 Watchdog Timer enabled (%d seconds%s)\n",
|
||||
wdt_time, nowayout ? ", nowayout" : "");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -268,8 +270,8 @@ static int __init at91_wdt_init(void)
|
||||
if not reset to the default */
|
||||
if (at91_wdt_settimeout(wdt_time)) {
|
||||
at91_wdt_settimeout(WDT_DEFAULT_TIME);
|
||||
pr_info("at91_wdt: wdt_time value must be 1 <= wdt_time <= 256"
|
||||
", using %d\n", wdt_time);
|
||||
pr_info("wdt_time value must be 1 <= wdt_time <= 256, using %d\n",
|
||||
wdt_time);
|
||||
}
|
||||
|
||||
return platform_driver_register(&at91wdt_driver);
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
* bootloader doesn't write to this register.
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
|
||||
#include <linux/errno.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/init.h>
|
||||
@@ -96,7 +98,7 @@ static void at91_ping(unsigned long data)
|
||||
at91_wdt_reset();
|
||||
mod_timer(&at91wdt_private.timer, jiffies + WDT_TIMEOUT);
|
||||
} else
|
||||
printk(KERN_CRIT DRV_NAME": I will reset your machine !\n");
|
||||
pr_crit("I will reset your machine !\n");
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -140,7 +142,7 @@ static int at91_wdt_settimeout(unsigned int timeout)
|
||||
/* Check if disabled */
|
||||
mr = wdt_read(AT91_WDT_MR);
|
||||
if (mr & AT91_WDT_WDDIS) {
|
||||
printk(KERN_ERR DRV_NAME": sorry, watchdog is disabled\n");
|
||||
pr_err("sorry, watchdog is disabled\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
@@ -283,7 +285,7 @@ static int __init at91wdt_probe(struct platform_device *pdev)
|
||||
setup_timer(&at91wdt_private.timer, at91_ping, 0);
|
||||
mod_timer(&at91wdt_private.timer, jiffies + WDT_TIMEOUT);
|
||||
|
||||
printk(KERN_INFO DRV_NAME " enabled (heartbeat=%d sec, nowayout=%d)\n",
|
||||
pr_info("enabled (heartbeat=%d sec, nowayout=%d)\n",
|
||||
heartbeat, nowayout);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/fs.h>
|
||||
@@ -114,8 +116,7 @@ static int ath79_wdt_release(struct inode *inode, struct file *file)
|
||||
if (test_bit(WDT_FLAGS_EXPECT_CLOSE, &wdt_flags))
|
||||
ath79_wdt_disable();
|
||||
else {
|
||||
pr_crit(DRIVER_NAME ": device closed unexpectedly, "
|
||||
"watchdog timer will not stop!\n");
|
||||
pr_crit("device closed unexpectedly, watchdog timer will not stop!\n");
|
||||
ath79_wdt_keepalive();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/fs.h>
|
||||
@@ -91,7 +93,7 @@ static void bcm47xx_timer_tick(unsigned long unused)
|
||||
bcm47xx_wdt_hw_start();
|
||||
mod_timer(&wdt_timer, jiffies + HZ);
|
||||
} else {
|
||||
printk(KERN_CRIT DRV_NAME "Watchdog will fire soon!!!\n");
|
||||
pr_crit("Watchdog will fire soon!!!\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,8 +142,7 @@ static int bcm47xx_wdt_release(struct inode *inode, struct file *file)
|
||||
if (expect_release == 42) {
|
||||
bcm47xx_wdt_stop();
|
||||
} else {
|
||||
printk(KERN_CRIT DRV_NAME
|
||||
": Unexpected close, not stopping watchdog!\n");
|
||||
pr_crit("Unexpected close, not stopping watchdog!\n");
|
||||
bcm47xx_wdt_start();
|
||||
}
|
||||
|
||||
@@ -270,8 +271,7 @@ static int __init bcm47xx_wdt_init(void)
|
||||
|
||||
if (bcm47xx_wdt_settimeout(wdt_time)) {
|
||||
bcm47xx_wdt_settimeout(WDT_DEFAULT_TIME);
|
||||
printk(KERN_INFO DRV_NAME ": "
|
||||
"wdt_time value must be 0 < wdt_time < %d, using %d\n",
|
||||
pr_info("wdt_time value must be 0 < wdt_time < %d, using %d\n",
|
||||
(WDT_MAX_TIME + 1), wdt_time);
|
||||
}
|
||||
|
||||
@@ -285,8 +285,8 @@ static int __init bcm47xx_wdt_init(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
printk(KERN_INFO "BCM47xx Watchdog Timer enabled (%d seconds%s)\n",
|
||||
wdt_time, nowayout ? ", nowayout" : "");
|
||||
pr_info("BCM47xx Watchdog Timer enabled (%d seconds%s)\n",
|
||||
wdt_time, nowayout ? ", nowayout" : "");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/fs.h>
|
||||
@@ -82,7 +84,7 @@ static void bcm63xx_timer_tick(unsigned long unused)
|
||||
bcm63xx_wdt_hw_start();
|
||||
mod_timer(&bcm63xx_wdt_device.timer, jiffies + HZ);
|
||||
} else
|
||||
printk(KERN_CRIT PFX ": watchdog will restart system\n");
|
||||
pr_crit("watchdog will restart system\n");
|
||||
}
|
||||
|
||||
static void bcm63xx_wdt_pet(void)
|
||||
@@ -126,8 +128,7 @@ static int bcm63xx_wdt_release(struct inode *inode, struct file *file)
|
||||
if (expect_close == 42)
|
||||
bcm63xx_wdt_pause();
|
||||
else {
|
||||
printk(KERN_CRIT PFX
|
||||
": Unexpected close, not stopping watchdog!\n");
|
||||
pr_crit("Unexpected close, not stopping watchdog!\n");
|
||||
bcm63xx_wdt_start();
|
||||
}
|
||||
clear_bit(0, &bcm63xx_wdt_device.inuse);
|
||||
|
||||
+10
-17
@@ -11,6 +11,8 @@
|
||||
* Licensed under the GPL-2 or later.
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/moduleparam.h>
|
||||
@@ -28,15 +30,8 @@
|
||||
#define stamp(fmt, args...) \
|
||||
pr_debug("%s:%i: " fmt "\n", __func__, __LINE__, ## args)
|
||||
#define stampit() stamp("here i am")
|
||||
#define pr_devinit(fmt, args...) \
|
||||
({ static const __devinitconst char __fmt[] = fmt; \
|
||||
printk(__fmt, ## args); })
|
||||
#define pr_init(fmt, args...) \
|
||||
({ static const __initconst char __fmt[] = fmt; \
|
||||
printk(__fmt, ## args); })
|
||||
|
||||
#define WATCHDOG_NAME "bfin-wdt"
|
||||
#define PFX WATCHDOG_NAME ": "
|
||||
|
||||
/* The BF561 has two watchdogs (one per core), but since Linux
|
||||
* only runs on core A, we'll just work with that one.
|
||||
@@ -126,7 +121,7 @@ static int bfin_wdt_set_timeout(unsigned long t)
|
||||
stamp("maxtimeout=%us newtimeout=%lus (cnt=%#x)", max_t, t, cnt);
|
||||
|
||||
if (t > max_t) {
|
||||
printk(KERN_WARNING PFX "timeout value is too large\n");
|
||||
pr_warn("timeout value is too large\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -182,8 +177,7 @@ static int bfin_wdt_release(struct inode *inode, struct file *file)
|
||||
if (expect_close == 42)
|
||||
bfin_wdt_stop();
|
||||
else {
|
||||
printk(KERN_CRIT PFX
|
||||
"Unexpected close, not stopping watchdog!\n");
|
||||
pr_crit("Unexpected close, not stopping watchdog!\n");
|
||||
bfin_wdt_keepalive();
|
||||
}
|
||||
expect_close = 0;
|
||||
@@ -368,14 +362,13 @@ static int __devinit bfin_wdt_probe(struct platform_device *pdev)
|
||||
|
||||
ret = misc_register(&bfin_wdt_miscdev);
|
||||
if (ret) {
|
||||
pr_devinit(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);
|
||||
return ret;
|
||||
}
|
||||
|
||||
pr_devinit(KERN_INFO PFX "initialized: timeout=%d sec (nowayout=%d)\n",
|
||||
timeout, nowayout);
|
||||
pr_info("initialized: timeout=%d sec (nowayout=%d)\n",
|
||||
timeout, nowayout);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -439,14 +432,14 @@ static int __init bfin_wdt_init(void)
|
||||
*/
|
||||
ret = platform_driver_register(&bfin_wdt_driver);
|
||||
if (ret) {
|
||||
pr_init(KERN_ERR PFX "unable to register driver\n");
|
||||
pr_err("unable to register driver\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
bfin_wdt_device = platform_device_register_simple(WATCHDOG_NAME,
|
||||
-1, NULL, 0);
|
||||
if (IS_ERR(bfin_wdt_device)) {
|
||||
pr_init(KERN_ERR PFX "unable to register device\n");
|
||||
pr_err("unable to register device\n");
|
||||
platform_driver_unregister(&bfin_wdt_driver);
|
||||
return PTR_ERR(bfin_wdt_device);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
* option) any later version.
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/smp.h>
|
||||
@@ -225,8 +227,8 @@ static int booke_wdt_open(struct inode *inode, struct file *file)
|
||||
if (booke_wdt_enabled == 0) {
|
||||
booke_wdt_enabled = 1;
|
||||
on_each_cpu(__booke_wdt_enable, NULL, 0);
|
||||
pr_debug("booke_wdt: watchdog enabled (timeout = %llu sec)\n",
|
||||
period_to_sec(booke_wdt_period));
|
||||
pr_debug("watchdog enabled (timeout = %llu sec)\n",
|
||||
period_to_sec(booke_wdt_period));
|
||||
}
|
||||
spin_unlock(&booke_wdt_lock);
|
||||
|
||||
@@ -243,7 +245,7 @@ static int booke_wdt_release(struct inode *inode, struct file *file)
|
||||
*/
|
||||
on_each_cpu(__booke_wdt_disable, NULL, 0);
|
||||
booke_wdt_enabled = 0;
|
||||
pr_debug("booke_wdt: watchdog disabled\n");
|
||||
pr_debug("watchdog disabled\n");
|
||||
#endif
|
||||
|
||||
clear_bit(0, &wdt_is_active);
|
||||
@@ -275,19 +277,19 @@ static int __init booke_wdt_init(void)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
pr_info("booke_wdt: powerpc book-e watchdog driver loaded\n");
|
||||
pr_info("powerpc book-e watchdog driver loaded\n");
|
||||
ident.firmware_version = cur_cpu_spec->pvr_value;
|
||||
|
||||
ret = misc_register(&booke_wdt_miscdev);
|
||||
if (ret) {
|
||||
pr_err("booke_wdt: cannot register device (minor=%u, ret=%i)\n",
|
||||
pr_err("cannot register device (minor=%u, ret=%i)\n",
|
||||
WATCHDOG_MINOR, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
spin_lock(&booke_wdt_lock);
|
||||
if (booke_wdt_enabled == 1) {
|
||||
pr_info("booke_wdt: watchdog enabled (timeout = %llu sec)\n",
|
||||
pr_info("watchdog enabled (timeout = %llu sec)\n",
|
||||
period_to_sec(booke_wdt_period));
|
||||
on_each_cpu(__booke_wdt_enable, NULL, 0);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <linux/types.h>
|
||||
@@ -71,7 +73,7 @@ static struct {
|
||||
static void cpu5wdt_trigger(unsigned long unused)
|
||||
{
|
||||
if (verbose > 2)
|
||||
printk(KERN_DEBUG PFX "trigger at %i ticks\n", ticks);
|
||||
pr_debug("trigger at %i ticks\n", ticks);
|
||||
|
||||
if (cpu5wdt_device.running)
|
||||
ticks--;
|
||||
@@ -96,7 +98,7 @@ static void cpu5wdt_reset(void)
|
||||
ticks = cpu5wdt_device.default_ticks;
|
||||
|
||||
if (verbose)
|
||||
printk(KERN_DEBUG PFX "reset (%i ticks)\n", (int) ticks);
|
||||
pr_debug("reset (%i ticks)\n", (int) ticks);
|
||||
|
||||
}
|
||||
|
||||
@@ -129,7 +131,7 @@ static int cpu5wdt_stop(void)
|
||||
ticks = cpu5wdt_device.default_ticks;
|
||||
spin_unlock_irqrestore(&cpu5wdt_lock, flags);
|
||||
if (verbose)
|
||||
printk(KERN_CRIT PFX "stop not possible\n");
|
||||
pr_crit("stop not possible\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
@@ -219,8 +221,7 @@ static int __devinit cpu5wdt_init(void)
|
||||
int err;
|
||||
|
||||
if (verbose)
|
||||
printk(KERN_DEBUG PFX
|
||||
"port=0x%x, verbose=%i\n", port, verbose);
|
||||
pr_debug("port=0x%x, verbose=%i\n", port, verbose);
|
||||
|
||||
init_completion(&cpu5wdt_device.stop);
|
||||
cpu5wdt_device.queue = 0;
|
||||
@@ -228,7 +229,7 @@ static int __devinit cpu5wdt_init(void)
|
||||
cpu5wdt_device.default_ticks = ticks;
|
||||
|
||||
if (!request_region(port, CPU5WDT_EXTENT, PFX)) {
|
||||
printk(KERN_ERR PFX "request_region failed\n");
|
||||
pr_err("request_region failed\n");
|
||||
err = -EBUSY;
|
||||
goto no_port;
|
||||
}
|
||||
@@ -237,16 +238,16 @@ static int __devinit cpu5wdt_init(void)
|
||||
val = inb(port + CPU5WDT_STATUS_REG);
|
||||
val = (val >> 2) & 1;
|
||||
if (!val)
|
||||
printk(KERN_INFO PFX "sorry, was my fault\n");
|
||||
pr_info("sorry, was my fault\n");
|
||||
|
||||
err = misc_register(&cpu5wdt_misc);
|
||||
if (err < 0) {
|
||||
printk(KERN_ERR PFX "misc_register failed\n");
|
||||
pr_err("misc_register failed\n");
|
||||
goto no_misc;
|
||||
}
|
||||
|
||||
|
||||
printk(KERN_INFO PFX "init success\n");
|
||||
pr_info("init success\n");
|
||||
return 0;
|
||||
|
||||
no_misc:
|
||||
|
||||
+10
-10
@@ -14,6 +14,8 @@
|
||||
* Copyright (C) 2008 David S. Miller <davem@davemloft.net>
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/fs.h>
|
||||
@@ -35,7 +37,6 @@
|
||||
#include <asm/watchdog.h>
|
||||
|
||||
#define DRIVER_NAME "cpwd"
|
||||
#define PFX DRIVER_NAME ": "
|
||||
|
||||
#define WD_OBPNAME "watchdog"
|
||||
#define WD_BADMODEL "SUNW,501-5336"
|
||||
@@ -385,8 +386,7 @@ static int cpwd_open(struct inode *inode, struct file *f)
|
||||
if (!p->initialized) {
|
||||
if (request_irq(p->irq, &cpwd_interrupt,
|
||||
IRQF_SHARED, DRIVER_NAME, p)) {
|
||||
printk(KERN_ERR PFX "Cannot register IRQ %d\n",
|
||||
p->irq);
|
||||
pr_err("Cannot register IRQ %d\n", p->irq);
|
||||
mutex_unlock(&cpwd_mutex);
|
||||
return -EBUSY;
|
||||
}
|
||||
@@ -542,7 +542,7 @@ static int __devinit cpwd_probe(struct platform_device *op)
|
||||
p = kzalloc(sizeof(*p), GFP_KERNEL);
|
||||
err = -ENOMEM;
|
||||
if (!p) {
|
||||
printk(KERN_ERR PFX "Unable to allocate struct cpwd.\n");
|
||||
pr_err("Unable to allocate struct cpwd\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -553,14 +553,14 @@ static int __devinit cpwd_probe(struct platform_device *op)
|
||||
p->regs = of_ioremap(&op->resource[0], 0,
|
||||
4 * WD_TIMER_REGSZ, DRIVER_NAME);
|
||||
if (!p->regs) {
|
||||
printk(KERN_ERR PFX "Unable to map registers.\n");
|
||||
pr_err("Unable to map registers\n");
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
options = of_find_node_by_path("/options");
|
||||
err = -ENODEV;
|
||||
if (!options) {
|
||||
printk(KERN_ERR PFX "Unable to find /options node.\n");
|
||||
pr_err("Unable to find /options node\n");
|
||||
goto out_iounmap;
|
||||
}
|
||||
|
||||
@@ -605,8 +605,8 @@ static int __devinit cpwd_probe(struct platform_device *op)
|
||||
|
||||
err = misc_register(&p->devs[i].misc);
|
||||
if (err) {
|
||||
printk(KERN_ERR "Could not register misc device for "
|
||||
"dev %d\n", i);
|
||||
pr_err("Could not register misc device for dev %d\n",
|
||||
i);
|
||||
goto out_unregister;
|
||||
}
|
||||
}
|
||||
@@ -617,8 +617,8 @@ static int __devinit cpwd_probe(struct platform_device *op)
|
||||
cpwd_timer.data = (unsigned long) p;
|
||||
cpwd_timer.expires = WD_BTIMEOUT;
|
||||
|
||||
printk(KERN_INFO PFX "PLD defect workaround enabled for "
|
||||
"model " WD_BADMODEL ".\n");
|
||||
pr_info("PLD defect workaround enabled for model %s\n",
|
||||
WD_BADMODEL);
|
||||
}
|
||||
|
||||
dev_set_drvdata(&op->dev, p);
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
* If we receive an expected close for the watchdog then we keep the timer
|
||||
* running, otherwise the timer is stopped and the watchdog will expire.
|
||||
*/
|
||||
#define pr_fmt(fmt) "dw_wdt: " fmt
|
||||
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/clk.h>
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
* - Add a few missing ioctls
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/miscdevice.h>
|
||||
@@ -33,7 +35,6 @@
|
||||
#include <mach/hardware.h>
|
||||
|
||||
#define WDT_VERSION "0.3"
|
||||
#define PFX "ep93xx_wdt: "
|
||||
|
||||
/* default timeout (secs) */
|
||||
#define WDT_TIMEOUT 30
|
||||
@@ -173,8 +174,7 @@ static int ep93xx_wdt_release(struct inode *inode, struct file *file)
|
||||
if (test_bit(WDT_OK_TO_CLOSE, &wdt_status))
|
||||
wdt_shutdown();
|
||||
else
|
||||
printk(KERN_CRIT PFX
|
||||
"Device closed unexpectedly - timer will not stop\n");
|
||||
pr_crit("Device closed unexpectedly - timer will not stop\n");
|
||||
|
||||
clear_bit(WDT_IN_USE, &wdt_status);
|
||||
clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
|
||||
@@ -214,15 +214,13 @@ static int __init ep93xx_wdt_init(void)
|
||||
|
||||
boot_status = __raw_readl(EP93XX_WDT_WATCHDOG) & 0x01 ? 1 : 0;
|
||||
|
||||
printk(KERN_INFO PFX "EP93XX watchdog, driver version "
|
||||
WDT_VERSION "%s\n",
|
||||
pr_info("EP93XX watchdog, driver version " WDT_VERSION "%s\n",
|
||||
(__raw_readl(EP93XX_WDT_WATCHDOG) & 0x08)
|
||||
? " (nCS1 disable detected)" : "");
|
||||
|
||||
if (timeout < 1 || timeout > 3600) {
|
||||
timeout = WDT_TIMEOUT;
|
||||
printk(KERN_INFO PFX
|
||||
"timeout value must be 1<=x<=3600, using %d\n",
|
||||
pr_info("timeout value must be 1<=x<=3600, using %d\n",
|
||||
timeout);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,8 @@
|
||||
* of the on-board SUPER I/O device SMSC FDC 37B782.
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/moduleparam.h>
|
||||
@@ -144,11 +146,11 @@ static void eurwdt_activate_timer(void)
|
||||
|
||||
/* Setting interrupt line */
|
||||
if (irq == 2 || irq > 15 || irq < 0) {
|
||||
printk(KERN_ERR ": invalid irq number\n");
|
||||
pr_err("invalid irq number\n");
|
||||
irq = 0; /* if invalid we disable interrupt */
|
||||
}
|
||||
if (irq == 0)
|
||||
printk(KERN_INFO ": interrupt disabled\n");
|
||||
pr_info("interrupt disabled\n");
|
||||
|
||||
eurwdt_write_reg(WDT_TIMER_CFG, irq << 4);
|
||||
|
||||
@@ -163,12 +165,12 @@ static void eurwdt_activate_timer(void)
|
||||
|
||||
static irqreturn_t eurwdt_interrupt(int irq, void *dev_id)
|
||||
{
|
||||
printk(KERN_CRIT "timeout WDT timeout\n");
|
||||
pr_crit("timeout WDT timeout\n");
|
||||
|
||||
#ifdef ONLY_TESTING
|
||||
printk(KERN_CRIT "Would Reboot.\n");
|
||||
pr_crit("Would Reboot\n");
|
||||
#else
|
||||
printk(KERN_CRIT "Initiating system reboot.\n");
|
||||
pr_crit("Initiating system reboot\n");
|
||||
emergency_restart();
|
||||
#endif
|
||||
return IRQ_HANDLED;
|
||||
@@ -335,8 +337,7 @@ static int eurwdt_release(struct inode *inode, struct file *file)
|
||||
if (eur_expect_close == 42)
|
||||
eurwdt_disable_timer();
|
||||
else {
|
||||
printk(KERN_CRIT
|
||||
"eurwdt: Unexpected close, not stopping watchdog!\n");
|
||||
pr_crit("Unexpected close, not stopping watchdog!\n");
|
||||
eurwdt_ping();
|
||||
}
|
||||
clear_bit(0, &eurwdt_is_open);
|
||||
@@ -429,35 +430,32 @@ static int __init eurwdt_init(void)
|
||||
|
||||
ret = request_irq(irq, eurwdt_interrupt, 0, "eurwdt", NULL);
|
||||
if (ret) {
|
||||
printk(KERN_ERR "eurwdt: IRQ %d is not free.\n", irq);
|
||||
pr_err("IRQ %d is not free\n", irq);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!request_region(io, 2, "eurwdt")) {
|
||||
printk(KERN_ERR "eurwdt: IO %X is not free.\n", io);
|
||||
pr_err("IO %X is not free\n", io);
|
||||
ret = -EBUSY;
|
||||
goto outirq;
|
||||
}
|
||||
|
||||
ret = register_reboot_notifier(&eurwdt_notifier);
|
||||
if (ret) {
|
||||
printk(KERN_ERR
|
||||
"eurwdt: can't register reboot notifier (err=%d)\n", ret);
|
||||
pr_err("can't register reboot notifier (err=%d)\n", ret);
|
||||
goto outreg;
|
||||
}
|
||||
|
||||
ret = misc_register(&eurwdt_miscdev);
|
||||
if (ret) {
|
||||
printk(KERN_ERR "eurwdt: can't misc_register on minor=%d\n",
|
||||
WATCHDOG_MINOR);
|
||||
pr_err("can't misc_register on minor=%d\n", WATCHDOG_MINOR);
|
||||
goto outreboot;
|
||||
}
|
||||
|
||||
eurwdt_unlock_chip();
|
||||
|
||||
ret = 0;
|
||||
printk(KERN_INFO "Eurotech WDT driver 0.01 at %X (Interrupt %d)"
|
||||
" - timeout event: %s\n",
|
||||
pr_info("Eurotech WDT driver 0.01 at %X (Interrupt %d) - timeout event: %s\n",
|
||||
io, irq, (!strcmp("int", ev) ? "int" : "reboot"));
|
||||
|
||||
out:
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
|
||||
#include <linux/err.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/init.h>
|
||||
@@ -189,8 +191,7 @@ static inline int superio_enter(int base)
|
||||
{
|
||||
/* Don't step on other drivers' I/O space by accident */
|
||||
if (!request_muxed_region(base, 2, DRVNAME)) {
|
||||
printk(KERN_ERR DRVNAME ": I/O address 0x%04x already in use\n",
|
||||
(int)base);
|
||||
pr_err("I/O address 0x%04x already in use\n", (int)base);
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
@@ -217,7 +218,7 @@ static int watchdog_set_timeout(int timeout)
|
||||
{
|
||||
if (timeout <= 0
|
||||
|| timeout > max_timeout) {
|
||||
printk(KERN_ERR DRVNAME ": watchdog timeout out of range\n");
|
||||
pr_err("watchdog timeout out of range\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -252,7 +253,7 @@ static int watchdog_set_pulse_width(unsigned int pw)
|
||||
} else if (pw <= 5000) {
|
||||
watchdog.pulse_val = 3;
|
||||
} else {
|
||||
printk(KERN_ERR DRVNAME ": pulse width out of range\n");
|
||||
pr_err("pulse width out of range\n");
|
||||
err = -EINVAL;
|
||||
goto exit_unlock;
|
||||
}
|
||||
@@ -309,8 +310,7 @@ static int f71862fg_pin_configure(unsigned short ioaddr)
|
||||
if (ioaddr)
|
||||
superio_set_bit(ioaddr, SIO_REG_MFUNCT1, 1);
|
||||
} else {
|
||||
printk(KERN_ERR DRVNAME ": Invalid argument f71862fg_pin=%d\n",
|
||||
f71862fg_pin);
|
||||
pr_err("Invalid argument f71862fg_pin=%d\n", f71862fg_pin);
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
@@ -487,8 +487,7 @@ static int watchdog_release(struct inode *inode, struct file *file)
|
||||
|
||||
if (!watchdog.expect_close) {
|
||||
watchdog_keepalive();
|
||||
printk(KERN_CRIT DRVNAME
|
||||
": Unexpected close, not stopping watchdog!\n");
|
||||
pr_crit("Unexpected close, not stopping watchdog!\n");
|
||||
} else if (!nowayout) {
|
||||
watchdog_stop();
|
||||
}
|
||||
@@ -672,25 +671,22 @@ static int __init watchdog_init(int sioaddr)
|
||||
|
||||
err = misc_register(&watchdog_miscdev);
|
||||
if (err) {
|
||||
printk(KERN_ERR DRVNAME
|
||||
": cannot register miscdev on minor=%d\n",
|
||||
watchdog_miscdev.minor);
|
||||
pr_err("cannot register miscdev on minor=%d\n",
|
||||
watchdog_miscdev.minor);
|
||||
goto exit_reboot;
|
||||
}
|
||||
|
||||
if (start_withtimeout) {
|
||||
if (start_withtimeout <= 0
|
||||
|| start_withtimeout > max_timeout) {
|
||||
printk(KERN_ERR DRVNAME
|
||||
": starting timeout out of range\n");
|
||||
pr_err("starting timeout out of range\n");
|
||||
err = -EINVAL;
|
||||
goto exit_miscdev;
|
||||
}
|
||||
|
||||
err = watchdog_start();
|
||||
if (err) {
|
||||
printk(KERN_ERR DRVNAME
|
||||
": cannot start watchdog timer\n");
|
||||
pr_err("cannot start watchdog timer\n");
|
||||
goto exit_miscdev;
|
||||
}
|
||||
|
||||
@@ -720,8 +716,7 @@ static int __init watchdog_init(int sioaddr)
|
||||
if (nowayout)
|
||||
__module_get(THIS_MODULE);
|
||||
|
||||
printk(KERN_INFO DRVNAME
|
||||
": watchdog started with initial timeout of %u sec\n",
|
||||
pr_info("watchdog started with initial timeout of %u sec\n",
|
||||
start_withtimeout);
|
||||
}
|
||||
|
||||
@@ -746,7 +741,7 @@ static int __init f71808e_find(int sioaddr)
|
||||
|
||||
devid = superio_inw(sioaddr, SIO_REG_MANID);
|
||||
if (devid != SIO_FINTEK_ID) {
|
||||
pr_debug(DRVNAME ": Not a Fintek device\n");
|
||||
pr_debug("Not a Fintek device\n");
|
||||
err = -ENODEV;
|
||||
goto exit;
|
||||
}
|
||||
@@ -774,13 +769,13 @@ static int __init f71808e_find(int sioaddr)
|
||||
err = -ENODEV;
|
||||
goto exit;
|
||||
default:
|
||||
printk(KERN_INFO DRVNAME ": Unrecognized Fintek device: %04x\n",
|
||||
(unsigned int)devid);
|
||||
pr_info("Unrecognized Fintek device: %04x\n",
|
||||
(unsigned int)devid);
|
||||
err = -ENODEV;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
printk(KERN_INFO DRVNAME ": Found %s watchdog chip, revision %d\n",
|
||||
pr_info("Found %s watchdog chip, revision %d\n",
|
||||
f71808e_names[watchdog.type],
|
||||
(int)superio_inb(sioaddr, SIO_REG_DEVREV));
|
||||
exit:
|
||||
@@ -808,8 +803,7 @@ static int __init f71808e_init(void)
|
||||
static void __exit f71808e_exit(void)
|
||||
{
|
||||
if (watchdog_is_running()) {
|
||||
printk(KERN_WARNING DRVNAME
|
||||
": Watchdog timer still running, stopping it\n");
|
||||
pr_warn("Watchdog timer still running, stopping it\n");
|
||||
watchdog_stop();
|
||||
}
|
||||
misc_deregister(&watchdog_miscdev);
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
* capabilities) a kernel-based watchdog.
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/init.h>
|
||||
@@ -110,7 +112,7 @@ static void gef_wdt_handler_enable(void)
|
||||
if (gef_wdt_toggle_wdc(GEF_WDC_ENABLED_FALSE,
|
||||
GEF_WDC_ENABLE_SHIFT)) {
|
||||
gef_wdt_service();
|
||||
printk(KERN_NOTICE "gef_wdt: watchdog activated\n");
|
||||
pr_notice("watchdog activated\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +120,7 @@ static void gef_wdt_handler_disable(void)
|
||||
{
|
||||
if (gef_wdt_toggle_wdc(GEF_WDC_ENABLED_TRUE,
|
||||
GEF_WDC_ENABLE_SHIFT))
|
||||
printk(KERN_NOTICE "gef_wdt: watchdog deactivated\n");
|
||||
pr_notice("watchdog deactivated\n");
|
||||
}
|
||||
|
||||
static void gef_wdt_set_timeout(unsigned int timeout)
|
||||
@@ -234,8 +236,7 @@ static int gef_wdt_release(struct inode *inode, struct file *file)
|
||||
if (expect_close == 42)
|
||||
gef_wdt_handler_disable();
|
||||
else {
|
||||
printk(KERN_CRIT
|
||||
"gef_wdt: unexpected close, not stopping timer!\n");
|
||||
pr_crit("unexpected close, not stopping timer!\n");
|
||||
gef_wdt_service();
|
||||
}
|
||||
expect_close = 0;
|
||||
@@ -313,7 +314,7 @@ static struct platform_driver gef_wdt_driver = {
|
||||
|
||||
static int __init gef_wdt_init(void)
|
||||
{
|
||||
printk(KERN_INFO "GE watchdog driver\n");
|
||||
pr_info("GE watchdog driver\n");
|
||||
return platform_driver_register(&gef_wdt_driver);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
* 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>
|
||||
@@ -100,7 +101,7 @@ static int geodewdt_release(struct inode *inode, struct file *file)
|
||||
geodewdt_disable();
|
||||
module_put(THIS_MODULE);
|
||||
} else {
|
||||
printk(KERN_CRIT "Unexpected close - watchdog is not stopping.\n");
|
||||
pr_crit("Unexpected close - watchdog is not stopping\n");
|
||||
geodewdt_ping();
|
||||
|
||||
set_bit(WDT_FLAGS_ORPHAN, &wdt_flags);
|
||||
@@ -220,7 +221,7 @@ static int __devinit geodewdt_probe(struct platform_device *dev)
|
||||
|
||||
wdt_timer = cs5535_mfgpt_alloc_timer(MFGPT_TIMER_ANY, MFGPT_DOMAIN_WORKING);
|
||||
if (!wdt_timer) {
|
||||
printk(KERN_ERR "geodewdt: No timers were available\n");
|
||||
pr_err("No timers were available\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user