aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/mpc8xxx_wdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/watchdog/mpc8xxx_wdt.c')
-rw-r--r--drivers/watchdog/mpc8xxx_wdt.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/watchdog/mpc8xxx_wdt.c b/drivers/watchdog/mpc8xxx_wdt.c
index 8fa213cdb499..eed5436ffb51 100644
--- a/drivers/watchdog/mpc8xxx_wdt.c
+++ b/drivers/watchdog/mpc8xxx_wdt.c
@@ -2,9 +2,9 @@
2 * mpc8xxx_wdt.c - MPC8xx/MPC83xx/MPC86xx watchdog userspace interface 2 * mpc8xxx_wdt.c - MPC8xx/MPC83xx/MPC86xx watchdog userspace interface
3 * 3 *
4 * Authors: Dave Updegraff <dave@cray.org> 4 * Authors: Dave Updegraff <dave@cray.org>
5 * Kumar Gala <galak@kernel.crashing.org> 5 * Kumar Gala <galak@kernel.crashing.org>
6 * Attribution: from 83xx_wst: Florian Schirmer <jolt@tuxbox.org> 6 * Attribution: from 83xx_wst: Florian Schirmer <jolt@tuxbox.org>
7 * ..and from sc520_wdt 7 * ..and from sc520_wdt
8 * Copyright (c) 2008 MontaVista Software, Inc. 8 * Copyright (c) 2008 MontaVista Software, Inc.
9 * Anton Vorontsov <avorontsov@ru.mvista.com> 9 * Anton Vorontsov <avorontsov@ru.mvista.com>
10 * 10 *
@@ -185,15 +185,21 @@ static struct miscdevice mpc8xxx_wdt_miscdev = {
185 .fops = &mpc8xxx_wdt_fops, 185 .fops = &mpc8xxx_wdt_fops,
186}; 186};
187 187
188static int __devinit mpc8xxx_wdt_probe(struct platform_device *ofdev, 188static const struct of_device_id mpc8xxx_wdt_match[];
189 const struct of_device_id *match) 189static int __devinit mpc8xxx_wdt_probe(struct platform_device *ofdev)
190{ 190{
191 int ret; 191 int ret;
192 const struct of_device_id *match;
192 struct device_node *np = ofdev->dev.of_node; 193 struct device_node *np = ofdev->dev.of_node;
193 struct mpc8xxx_wdt_type *wdt_type = match->data; 194 struct mpc8xxx_wdt_type *wdt_type;
194 u32 freq = fsl_get_sys_freq(); 195 u32 freq = fsl_get_sys_freq();
195 bool enabled; 196 bool enabled;
196 197
198 match = of_match_device(mpc8xxx_wdt_match, &ofdev->dev);
199 if (!match)
200 return -EINVAL;
201 wdt_type = match->data;
202
197 if (!freq || freq == -1) 203 if (!freq || freq == -1)
198 return -EINVAL; 204 return -EINVAL;
199 205
@@ -272,7 +278,7 @@ static const struct of_device_id mpc8xxx_wdt_match[] = {
272}; 278};
273MODULE_DEVICE_TABLE(of, mpc8xxx_wdt_match); 279MODULE_DEVICE_TABLE(of, mpc8xxx_wdt_match);
274 280
275static struct of_platform_driver mpc8xxx_wdt_driver = { 281static struct platform_driver mpc8xxx_wdt_driver = {
276 .probe = mpc8xxx_wdt_probe, 282 .probe = mpc8xxx_wdt_probe,
277 .remove = __devexit_p(mpc8xxx_wdt_remove), 283 .remove = __devexit_p(mpc8xxx_wdt_remove),
278 .driver = { 284 .driver = {
@@ -308,13 +314,13 @@ module_init(mpc8xxx_wdt_init_late);
308 314
309static int __init mpc8xxx_wdt_init(void) 315static int __init mpc8xxx_wdt_init(void)
310{ 316{
311 return of_register_platform_driver(&mpc8xxx_wdt_driver); 317 return platform_driver_register(&mpc8xxx_wdt_driver);
312} 318}
313arch_initcall(mpc8xxx_wdt_init); 319arch_initcall(mpc8xxx_wdt_init);
314 320
315static void __exit mpc8xxx_wdt_exit(void) 321static void __exit mpc8xxx_wdt_exit(void)
316{ 322{
317 of_unregister_platform_driver(&mpc8xxx_wdt_driver); 323 platform_driver_unregister(&mpc8xxx_wdt_driver);
318} 324}
319module_exit(mpc8xxx_wdt_exit); 325module_exit(mpc8xxx_wdt_exit);
320 326