]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
watchdog: tegra: remove reboot notifier
authorColin Cross <ccross@android.com>
Mon, 14 Apr 2014 22:42:28 +0000 (15:42 -0700)
committerDhiren Parmar <dparmar@nvidia.com>
Sun, 17 Aug 2014 08:44:53 +0000 (01:44 -0700)
We don't want to disable the watchdog on reboot, it will catch
cases where reboot fails.  On power down, tegra_wdt_remove will
be called and will disable the watchdog.

Reviewed-on: http://git-master/r/433778
(cherry picked from commit c857e334d19a74bf100dc4a8e4f99f3666bd6aad)

Change-Id: I7ae61b3193c7689a8201e3b6ff49df7989859fcb
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Arun Kannan <akannan@nvidia.com>
Reviewed-on: http://git-master/r/454844
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mitch Luban <mluban@nvidia.com>
Tested-by: Mitch Luban <mluban@nvidia.com>
GVS: Gerrit_Virtual_Submit

drivers/watchdog/tegra_wdt.c

index 07b5cf1458de54e0318b50d1cc01a22cf86df84d..e88598c1ed10a18d7b8c6299ddcd666ad1db9f4e 100644 (file)
@@ -29,9 +29,7 @@
 #include <linux/io.h>
 #include <linux/kernel.h>
 #include <linux/miscdevice.h>
-#include <linux/notifier.h>
 #include <linux/platform_device.h>
-#include <linux/reboot.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/uaccess.h>
@@ -50,7 +48,6 @@ enum tegra_wdt_status {
 
 struct tegra_wdt {
        struct miscdevice       miscdev;
-       struct notifier_block   notifier;
        struct resource         *res_src;
        struct resource         *res_wdt;
        unsigned long           users;
@@ -167,16 +164,6 @@ static void tegra_wdt_disable(struct tegra_wdt *wdt)
 
 #endif
 
-static int tegra_wdt_notify(struct notifier_block *this,
-                           unsigned long code, void *dev)
-{
-       struct tegra_wdt *wdt = container_of(this, struct tegra_wdt, notifier);
-
-       if (code == SYS_DOWN || code == SYS_HALT)
-               tegra_wdt_disable(wdt);
-       return NOTIFY_DONE;
-}
-
 static int tegra_wdt_open(struct inode *inode, struct file *file)
 {
        struct miscdevice *mdev = file->private_data;
@@ -329,8 +316,6 @@ static int tegra_wdt_probe(struct platform_device *pdev)
        }
        wdt->miscdev.fops = &tegra_wdt_fops;
 
-       wdt->notifier.notifier_call = tegra_wdt_notify;
-
        res_src = request_mem_region(res_src->start, resource_size(res_src),
                                     pdev->name);
        res_wdt = request_mem_region(res_wdt->start, resource_size(res_wdt),
@@ -363,16 +348,9 @@ static int tegra_wdt_probe(struct platform_device *pdev)
        wdt->res_wdt = res_wdt;
        wdt->status = WDT_DISABLED;
 
-       ret = register_reboot_notifier(&wdt->notifier);
-       if (ret) {
-               dev_err(&pdev->dev, "cannot register reboot notifier\n");
-               goto fail;
-       }
-
        ret = misc_register(&wdt->miscdev);
        if (ret) {
                dev_err(&pdev->dev, "failed to register misc device\n");
-               unregister_reboot_notifier(&wdt->notifier);
                goto fail;
        }
 
@@ -408,7 +386,6 @@ static int tegra_wdt_remove(struct platform_device *pdev)
 
        tegra_wdt_disable(wdt);
 
-       unregister_reboot_notifier(&wdt->notifier);
        misc_deregister(&wdt->miscdev);
        iounmap(wdt->wdt_source);
        iounmap(wdt->wdt_timer);