diff options
Diffstat (limited to 'arch/blackfin/kernel')
-rw-r--r-- | arch/blackfin/kernel/nmi.c | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/arch/blackfin/kernel/nmi.c b/arch/blackfin/kernel/nmi.c index 0b5f72f17fd0..401eb1d8e3b4 100644 --- a/arch/blackfin/kernel/nmi.c +++ b/arch/blackfin/kernel/nmi.c | |||
@@ -12,7 +12,7 @@ | |||
12 | 12 | ||
13 | #include <linux/bitops.h> | 13 | #include <linux/bitops.h> |
14 | #include <linux/hardirq.h> | 14 | #include <linux/hardirq.h> |
15 | #include <linux/sysdev.h> | 15 | #include <linux/syscore_ops.h> |
16 | #include <linux/pm.h> | 16 | #include <linux/pm.h> |
17 | #include <linux/nmi.h> | 17 | #include <linux/nmi.h> |
18 | #include <linux/smp.h> | 18 | #include <linux/smp.h> |
@@ -196,43 +196,31 @@ void touch_nmi_watchdog(void) | |||
196 | 196 | ||
197 | /* Suspend/resume support */ | 197 | /* Suspend/resume support */ |
198 | #ifdef CONFIG_PM | 198 | #ifdef CONFIG_PM |
199 | static int nmi_wdt_suspend(struct sys_device *dev, pm_message_t state) | 199 | static int nmi_wdt_suspend(void) |
200 | { | 200 | { |
201 | nmi_wdt_stop(); | 201 | nmi_wdt_stop(); |
202 | return 0; | 202 | return 0; |
203 | } | 203 | } |
204 | 204 | ||
205 | static int nmi_wdt_resume(struct sys_device *dev) | 205 | static void nmi_wdt_resume(void) |
206 | { | 206 | { |
207 | if (nmi_active) | 207 | if (nmi_active) |
208 | nmi_wdt_start(); | 208 | nmi_wdt_start(); |
209 | return 0; | ||
210 | } | 209 | } |
211 | 210 | ||
212 | static struct sysdev_class nmi_sysclass = { | 211 | static struct syscore_ops nmi_syscore_ops = { |
213 | .name = DRV_NAME, | ||
214 | .resume = nmi_wdt_resume, | 212 | .resume = nmi_wdt_resume, |
215 | .suspend = nmi_wdt_suspend, | 213 | .suspend = nmi_wdt_suspend, |
216 | }; | 214 | }; |
217 | 215 | ||
218 | static struct sys_device device_nmi_wdt = { | 216 | static int __init init_nmi_wdt_syscore(void) |
219 | .id = 0, | ||
220 | .cls = &nmi_sysclass, | ||
221 | }; | ||
222 | |||
223 | static int __init init_nmi_wdt_sysfs(void) | ||
224 | { | 217 | { |
225 | int error; | 218 | if (nmi_active) |
226 | 219 | register_syscore_ops(&nmi_syscore_ops); | |
227 | if (!nmi_active) | ||
228 | return 0; | ||
229 | 220 | ||
230 | error = sysdev_class_register(&nmi_sysclass); | 221 | return 0; |
231 | if (!error) | ||
232 | error = sysdev_register(&device_nmi_wdt); | ||
233 | return error; | ||
234 | } | 222 | } |
235 | late_initcall(init_nmi_wdt_sysfs); | 223 | late_initcall(init_nmi_wdt_syscore); |
236 | 224 | ||
237 | #endif /* CONFIG_PM */ | 225 | #endif /* CONFIG_PM */ |
238 | 226 | ||