diff options
Diffstat (limited to 'drivers/watchdog/mpc8xxx_wdt.c')
-rw-r--r-- | drivers/watchdog/mpc8xxx_wdt.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/watchdog/mpc8xxx_wdt.c b/drivers/watchdog/mpc8xxx_wdt.c index 8fa213cdb499..ea438ad53055 100644 --- a/drivers/watchdog/mpc8xxx_wdt.c +++ b/drivers/watchdog/mpc8xxx_wdt.c | |||
@@ -185,15 +185,18 @@ static struct miscdevice mpc8xxx_wdt_miscdev = { | |||
185 | .fops = &mpc8xxx_wdt_fops, | 185 | .fops = &mpc8xxx_wdt_fops, |
186 | }; | 186 | }; |
187 | 187 | ||
188 | static int __devinit mpc8xxx_wdt_probe(struct platform_device *ofdev, | 188 | static int __devinit mpc8xxx_wdt_probe(struct platform_device *ofdev) |
189 | const struct of_device_id *match) | ||
190 | { | 189 | { |
191 | int ret; | 190 | int ret; |
192 | struct device_node *np = ofdev->dev.of_node; | 191 | struct device_node *np = ofdev->dev.of_node; |
193 | struct mpc8xxx_wdt_type *wdt_type = match->data; | 192 | struct mpc8xxx_wdt_type *wdt_type; |
194 | u32 freq = fsl_get_sys_freq(); | 193 | u32 freq = fsl_get_sys_freq(); |
195 | bool enabled; | 194 | bool enabled; |
196 | 195 | ||
196 | if (!ofdev->dev.of_match) | ||
197 | return -EINVAL; | ||
198 | wdt_type = match->data; | ||
199 | |||
197 | if (!freq || freq == -1) | 200 | if (!freq || freq == -1) |
198 | return -EINVAL; | 201 | return -EINVAL; |
199 | 202 | ||
@@ -272,7 +275,7 @@ static const struct of_device_id mpc8xxx_wdt_match[] = { | |||
272 | }; | 275 | }; |
273 | MODULE_DEVICE_TABLE(of, mpc8xxx_wdt_match); | 276 | MODULE_DEVICE_TABLE(of, mpc8xxx_wdt_match); |
274 | 277 | ||
275 | static struct of_platform_driver mpc8xxx_wdt_driver = { | 278 | static struct platform_driver mpc8xxx_wdt_driver = { |
276 | .probe = mpc8xxx_wdt_probe, | 279 | .probe = mpc8xxx_wdt_probe, |
277 | .remove = __devexit_p(mpc8xxx_wdt_remove), | 280 | .remove = __devexit_p(mpc8xxx_wdt_remove), |
278 | .driver = { | 281 | .driver = { |
@@ -308,13 +311,13 @@ module_init(mpc8xxx_wdt_init_late); | |||
308 | 311 | ||
309 | static int __init mpc8xxx_wdt_init(void) | 312 | static int __init mpc8xxx_wdt_init(void) |
310 | { | 313 | { |
311 | return of_register_platform_driver(&mpc8xxx_wdt_driver); | 314 | return platform_driver_register(&mpc8xxx_wdt_driver); |
312 | } | 315 | } |
313 | arch_initcall(mpc8xxx_wdt_init); | 316 | arch_initcall(mpc8xxx_wdt_init); |
314 | 317 | ||
315 | static void __exit mpc8xxx_wdt_exit(void) | 318 | static void __exit mpc8xxx_wdt_exit(void) |
316 | { | 319 | { |
317 | of_unregister_platform_driver(&mpc8xxx_wdt_driver); | 320 | platform_driver_unregister(&mpc8xxx_wdt_driver); |
318 | } | 321 | } |
319 | module_exit(mpc8xxx_wdt_exit); | 322 | module_exit(mpc8xxx_wdt_exit); |
320 | 323 | ||