Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 222804
b: refs/heads/master
c: e6c3b69
h: refs/heads/master
v: v3
  • Loading branch information
Wim Van Sebroeck committed Dec 2, 2010
1 parent b06caef commit 9aa37b3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 31 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: c54fb811745967732bc9e31d837e0c9925e12b4b
refs/heads/master: e6c3b699b2f6fcba7036c079b6f16bf9556c7f0d
42 changes: 12 additions & 30 deletions trunk/drivers/watchdog/bcm63xx_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <linux/miscdevice.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/reboot.h>
#include <linux/types.h>
#include <linux/uaccess.h>
#include <linux/watchdog.h>
Expand Down Expand Up @@ -220,14 +219,6 @@ static long bcm63xx_wdt_ioctl(struct file *file, unsigned int cmd,
}
}

static int bcm63xx_wdt_notify_sys(struct notifier_block *this,
unsigned long code, void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT)
bcm63xx_wdt_pause();
return NOTIFY_DONE;
}

static const struct file_operations bcm63xx_wdt_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
Expand All @@ -243,12 +234,8 @@ static struct miscdevice bcm63xx_wdt_miscdev = {
.fops = &bcm63xx_wdt_fops,
};

static struct notifier_block bcm63xx_wdt_notifier = {
.notifier_call = bcm63xx_wdt_notify_sys,
};


static int bcm63xx_wdt_probe(struct platform_device *pdev)
static int __devinit bcm63xx_wdt_probe(struct platform_device *pdev)
{
int ret;
struct resource *r;
Expand Down Expand Up @@ -280,51 +267,46 @@ static int bcm63xx_wdt_probe(struct platform_device *pdev)
wdt_time);
}

ret = register_reboot_notifier(&bcm63xx_wdt_notifier);
if (ret) {
dev_err(&pdev->dev, "failed to register reboot_notifier\n");
goto unregister_timer;
}

ret = misc_register(&bcm63xx_wdt_miscdev);
if (ret < 0) {
dev_err(&pdev->dev, "failed to register watchdog device\n");
goto unregister_reboot_notifier;
goto unregister_timer;
}

dev_info(&pdev->dev, " started, timer margin: %d sec\n",
WDT_DEFAULT_TIME);

return 0;

unregister_reboot_notifier:
unregister_reboot_notifier(&bcm63xx_wdt_notifier);
unregister_timer:
bcm63xx_timer_unregister(TIMER_WDT_ID);
unmap:
iounmap(bcm63xx_wdt_device.regs);
return ret;
}

static int bcm63xx_wdt_remove(struct platform_device *pdev)
static int __devexit bcm63xx_wdt_remove(struct platform_device *pdev)
{
if (!nowayout)
bcm63xx_wdt_pause();

misc_deregister(&bcm63xx_wdt_miscdev);

iounmap(bcm63xx_wdt_device.regs);

unregister_reboot_notifier(&bcm63xx_wdt_notifier);
bcm63xx_timer_unregister(TIMER_WDT_ID);

iounmap(bcm63xx_wdt_device.regs);
return 0;
}

static void bcm63xx_wdt_shutdown(struct platform_device *pdev)
{
bcm63xx_wdt_pause();
}

static struct platform_driver bcm63xx_wdt = {
.probe = bcm63xx_wdt_probe,
.remove = bcm63xx_wdt_remove,
.remove = __devexit_p(bcm63xx_wdt_remove),
.shutdown = bcm63xx_wdt_shutdown,
.driver = {
.owner = THIS_MODULE,
.name = "bcm63xx-wdt",
}
};
Expand Down

0 comments on commit 9aa37b3

Please sign in to comment.