diff options
Diffstat (limited to 'drivers/watchdog/txx9wdt.c')
| -rw-r--r-- | drivers/watchdog/txx9wdt.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/drivers/watchdog/txx9wdt.c b/drivers/watchdog/txx9wdt.c index d635566e9307..9e9ed7bfabcb 100644 --- a/drivers/watchdog/txx9wdt.c +++ b/drivers/watchdog/txx9wdt.c | |||
| @@ -13,7 +13,6 @@ | |||
| 13 | #include <linux/miscdevice.h> | 13 | #include <linux/miscdevice.h> |
| 14 | #include <linux/watchdog.h> | 14 | #include <linux/watchdog.h> |
| 15 | #include <linux/fs.h> | 15 | #include <linux/fs.h> |
| 16 | #include <linux/reboot.h> | ||
| 17 | #include <linux/init.h> | 16 | #include <linux/init.h> |
| 18 | #include <linux/uaccess.h> | 17 | #include <linux/uaccess.h> |
| 19 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
| @@ -166,14 +165,6 @@ static long txx9wdt_ioctl(struct file *file, unsigned int cmd, | |||
| 166 | } | 165 | } |
| 167 | } | 166 | } |
| 168 | 167 | ||
| 169 | static int txx9wdt_notify_sys(struct notifier_block *this, unsigned long code, | ||
| 170 | void *unused) | ||
| 171 | { | ||
| 172 | if (code == SYS_DOWN || code == SYS_HALT) | ||
| 173 | txx9wdt_stop(); | ||
| 174 | return NOTIFY_DONE; | ||
| 175 | } | ||
| 176 | |||
| 177 | static const struct file_operations txx9wdt_fops = { | 168 | static const struct file_operations txx9wdt_fops = { |
| 178 | .owner = THIS_MODULE, | 169 | .owner = THIS_MODULE, |
| 179 | .llseek = no_llseek, | 170 | .llseek = no_llseek, |
| @@ -189,10 +180,6 @@ static struct miscdevice txx9wdt_miscdev = { | |||
| 189 | .fops = &txx9wdt_fops, | 180 | .fops = &txx9wdt_fops, |
| 190 | }; | 181 | }; |
| 191 | 182 | ||
| 192 | static struct notifier_block txx9wdt_notifier = { | ||
| 193 | .notifier_call = txx9wdt_notify_sys, | ||
| 194 | }; | ||
| 195 | |||
| 196 | static int __init txx9wdt_probe(struct platform_device *dev) | 183 | static int __init txx9wdt_probe(struct platform_device *dev) |
| 197 | { | 184 | { |
| 198 | struct resource *res; | 185 | struct resource *res; |
| @@ -221,13 +208,8 @@ static int __init txx9wdt_probe(struct platform_device *dev) | |||
| 221 | if (!txx9wdt_reg) | 208 | if (!txx9wdt_reg) |
| 222 | goto exit_busy; | 209 | goto exit_busy; |
| 223 | 210 | ||
| 224 | ret = register_reboot_notifier(&txx9wdt_notifier); | ||
| 225 | if (ret) | ||
| 226 | goto exit; | ||
| 227 | |||
| 228 | ret = misc_register(&txx9wdt_miscdev); | 211 | ret = misc_register(&txx9wdt_miscdev); |
| 229 | if (ret) { | 212 | if (ret) { |
| 230 | unregister_reboot_notifier(&txx9wdt_notifier); | ||
| 231 | goto exit; | 213 | goto exit; |
| 232 | } | 214 | } |
| 233 | 215 | ||
| @@ -249,14 +231,19 @@ exit: | |||
| 249 | static int __exit txx9wdt_remove(struct platform_device *dev) | 231 | static int __exit txx9wdt_remove(struct platform_device *dev) |
| 250 | { | 232 | { |
| 251 | misc_deregister(&txx9wdt_miscdev); | 233 | misc_deregister(&txx9wdt_miscdev); |
| 252 | unregister_reboot_notifier(&txx9wdt_notifier); | ||
| 253 | clk_disable(txx9_imclk); | 234 | clk_disable(txx9_imclk); |
| 254 | clk_put(txx9_imclk); | 235 | clk_put(txx9_imclk); |
| 255 | return 0; | 236 | return 0; |
| 256 | } | 237 | } |
| 257 | 238 | ||
| 239 | static void txx9wdt_shutdown(struct platform_device *dev) | ||
| 240 | { | ||
| 241 | txx9wdt_stop(); | ||
| 242 | } | ||
| 243 | |||
| 258 | static struct platform_driver txx9wdt_driver = { | 244 | static struct platform_driver txx9wdt_driver = { |
| 259 | .remove = __exit_p(txx9wdt_remove), | 245 | .remove = __exit_p(txx9wdt_remove), |
| 246 | .shutdown = txx9wdt_shutdown, | ||
| 260 | .driver = { | 247 | .driver = { |
| 261 | .name = "txx9wdt", | 248 | .name = "txx9wdt", |
| 262 | .owner = THIS_MODULE, | 249 | .owner = THIS_MODULE, |
