Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-wat…
Browse files Browse the repository at this point in the history
…chdog

* git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog:
  [WATCHDOG] constify function pointer tables
  [WATCHDOG] TXx9 watchdog driver
  [WATCHDOG] misc_register patch	
  [WATCHDOG] wdt: fix locking
  • Loading branch information
Linus Torvalds committed Jan 28, 2008
2 parents e189f34 + b47a166 commit 8561b08
Show file tree
Hide file tree
Showing 16 changed files with 375 additions and 68 deletions.
6 changes: 6 additions & 0 deletions drivers/watchdog/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,12 @@ config AR7_WDT
help
Hardware driver for the TI AR7 Watchdog Timer.

config TXX9_WDT
tristate "Toshiba TXx9 Watchdog Timer"
depends on CPU_TX39XX || CPU_TX49XX
help
Hardware driver for the built-in watchdog timer on TXx9 MIPS SoCs.

# PARISC Architecture

# POWERPC Architecture
Expand Down
1 change: 1 addition & 0 deletions drivers/watchdog/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ obj-$(CONFIG_INDYDOG) += indydog.o
obj-$(CONFIG_WDT_MTX1) += mtx-1_wdt.o
obj-$(CONFIG_WDT_RM9K_GPI) += rm9k_wdt.o
obj-$(CONFIG_AR7_WDT) += ar7_wdt.o
obj-$(CONFIG_TXX9_WDT) += txx9wdt.o

# PARISC Architecture

Expand Down
20 changes: 10 additions & 10 deletions drivers/watchdog/alim1535_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,27 +413,27 @@ static int __init watchdog_init(void)
/* Calculate the watchdog's timeout */
ali_settimer(timeout);

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

ret = register_reboot_notifier(&ali_notifier);
ret = misc_register(&ali_miscdev);
if (ret != 0) {
printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
ret);
goto unreg_miscdev;
printk(KERN_ERR PFX "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",
timeout, nowayout);

out:
return ret;
unreg_miscdev:
misc_deregister(&ali_miscdev);
unreg_reboot:
unregister_reboot_notifier(&ali_notifier);
goto out;
}

Expand All @@ -449,8 +449,8 @@ static void __exit watchdog_exit(void)
ali_stop();

/* Deregister */
unregister_reboot_notifier(&ali_notifier);
misc_deregister(&ali_miscdev);
unregister_reboot_notifier(&ali_notifier);
pci_dev_put(ali_pci);
}

Expand Down
18 changes: 9 additions & 9 deletions drivers/watchdog/alim7101_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,18 +377,18 @@ static int __init alim7101_wdt_init(void)
timeout);
}

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

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

if (nowayout) {
Expand All @@ -399,8 +399,8 @@ static int __init alim7101_wdt_init(void)
timeout, nowayout);
return 0;

err_out_miscdev:
misc_deregister(&wdt_miscdev);
err_out_reboot:
unregister_reboot_notifier(&wdt_notifier);
err_out:
pci_dev_put(alim7101_pmu);
return rc;
Expand Down
2 changes: 1 addition & 1 deletion drivers/watchdog/ar7_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ static int ar7_wdt_ioctl(struct inode *inode, struct file *file,
}
}

static struct file_operations ar7_wdt_fops = {
static const struct file_operations ar7_wdt_fops = {
.owner = THIS_MODULE,
.write = ar7_wdt_write,
.ioctl = ar7_wdt_ioctl,
Expand Down
2 changes: 1 addition & 1 deletion drivers/watchdog/bfin_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ static struct platform_driver bfin_wdt_driver = {
.resume = bfin_wdt_resume,
};

static struct file_operations bfin_wdt_fops = {
static const struct file_operations bfin_wdt_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
.write = bfin_wdt_write,
Expand Down
2 changes: 1 addition & 1 deletion drivers/watchdog/it8712f_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ it8712f_wdt_release(struct inode *inode, struct file *file)
return 0;
}

static struct file_operations it8712f_wdt_fops = {
static const struct file_operations it8712f_wdt_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
.write = it8712f_wdt_write,
Expand Down
2 changes: 1 addition & 1 deletion drivers/watchdog/mpc5200_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ static int mpc5200_wdt_release(struct inode *inode, struct file *file)
return 0;
}

static struct file_operations mpc5200_wdt_fops = {
static const struct file_operations mpc5200_wdt_fops = {
.owner = THIS_MODULE,
.write = mpc5200_wdt_write,
.ioctl = mpc5200_wdt_ioctl,
Expand Down
2 changes: 1 addition & 1 deletion drivers/watchdog/mtx-1_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ static ssize_t mtx1_wdt_write(struct file *file, const char *buf, size_t count,
return count;
}

static struct file_operations mtx1_wdt_fops = {
static const struct file_operations mtx1_wdt_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
.ioctl = mtx1_wdt_ioctl,
Expand Down
18 changes: 9 additions & 9 deletions drivers/watchdog/sbc60xxwdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,29 +359,29 @@ static int __init sbc60xxwdt_init(void)
}
}

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

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

printk(KERN_INFO PFX "WDT driver for 60XX single board computer initialised. timeout=%d sec (nowayout=%d)\n",
timeout, nowayout);

return 0;

err_out_miscdev:
misc_deregister(&wdt_miscdev);
err_out_reboot:
unregister_reboot_notifier(&wdt_notifier);
err_out_region2:
if ((wdt_stop != 0x45) && (wdt_stop != wdt_start))
release_region(wdt_stop,1);
Expand Down
10 changes: 5 additions & 5 deletions drivers/watchdog/scx200_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,17 +231,17 @@ static int __init scx200_wdt_init(void)

sema_init(&open_semaphore, 1);

r = misc_register(&scx200_wdt_miscdev);
r = register_reboot_notifier(&scx200_wdt_notifier);
if (r) {
printk(KERN_ERR NAME ": unable to register reboot notifier");
release_region(scx200_cb_base + SCx200_WDT_OFFSET,
SCx200_WDT_SIZE);
return r;
}

r = register_reboot_notifier(&scx200_wdt_notifier);
r = misc_register(&scx200_wdt_miscdev);
if (r) {
printk(KERN_ERR NAME ": unable to register reboot notifier");
misc_deregister(&scx200_wdt_miscdev);
unregister_reboot_notifier(&scx200_wdt_notifier);
release_region(scx200_cb_base + SCx200_WDT_OFFSET,
SCx200_WDT_SIZE);
return r;
Expand All @@ -252,8 +252,8 @@ static int __init scx200_wdt_init(void)

static void __exit scx200_wdt_cleanup(void)
{
unregister_reboot_notifier(&scx200_wdt_notifier);
misc_deregister(&scx200_wdt_miscdev);
unregister_reboot_notifier(&scx200_wdt_notifier);
release_region(scx200_cb_base + SCx200_WDT_OFFSET,
SCx200_WDT_SIZE);
}
Expand Down
Loading

0 comments on commit 8561b08

Please sign in to comment.