aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/watchdog/s3c2410_wdt.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2005-11-09 17:32:44 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-11-09 17:32:44 -0500
commit3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 (patch)
treed8825be54cefb6ad6707478d719c8e30605bee7b /drivers/char/watchdog/s3c2410_wdt.c
parent00d3dcdd96646be6059cc21f2efa94c4edc1eda5 (diff)
[DRIVER MODEL] Convert platform drivers to use struct platform_driver
This allows us to eliminate the casts in the drivers, and eventually remove the use of the device_driver function pointer methods for platform device drivers. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/char/watchdog/s3c2410_wdt.c')
-rw-r--r--drivers/char/watchdog/s3c2410_wdt.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/char/watchdog/s3c2410_wdt.c b/drivers/char/watchdog/s3c2410_wdt.c
index 751cb77b0715..eb667daee19b 100644
--- a/drivers/char/watchdog/s3c2410_wdt.c
+++ b/drivers/char/watchdog/s3c2410_wdt.c
@@ -347,15 +347,14 @@ static irqreturn_t s3c2410wdt_irq(int irqno, void *param,
347} 347}
348/* device interface */ 348/* device interface */
349 349
350static int s3c2410wdt_probe(struct device *dev) 350static int s3c2410wdt_probe(struct platform_device *pdev)
351{ 351{
352 struct platform_device *pdev = to_platform_device(dev);
353 struct resource *res; 352 struct resource *res;
354 int started = 0; 353 int started = 0;
355 int ret; 354 int ret;
356 int size; 355 int size;
357 356
358 DBG("%s: probe=%p, device=%p\n", __FUNCTION__, pdev, dev); 357 DBG("%s: probe=%p\n", __FUNCTION__, pdev);
359 358
360 /* get the memory region for the watchdog timer */ 359 /* get the memory region for the watchdog timer */
361 360
@@ -386,13 +385,13 @@ static int s3c2410wdt_probe(struct device *dev)
386 return -ENOENT; 385 return -ENOENT;
387 } 386 }
388 387
389 ret = request_irq(res->start, s3c2410wdt_irq, 0, pdev->name, dev); 388 ret = request_irq(res->start, s3c2410wdt_irq, 0, pdev->name, pdev);
390 if (ret != 0) { 389 if (ret != 0) {
391 printk(KERN_INFO PFX "failed to install irq (%d)\n", ret); 390 printk(KERN_INFO PFX "failed to install irq (%d)\n", ret);
392 return ret; 391 return ret;
393 } 392 }
394 393
395 wdt_clock = clk_get(dev, "watchdog"); 394 wdt_clock = clk_get(&pdev->dev, "watchdog");
396 if (wdt_clock == NULL) { 395 if (wdt_clock == NULL) {
397 printk(KERN_INFO PFX "failed to find watchdog clock source\n"); 396 printk(KERN_INFO PFX "failed to find watchdog clock source\n");
398 return -ENOENT; 397 return -ENOENT;
@@ -430,7 +429,7 @@ static int s3c2410wdt_probe(struct device *dev)
430 return 0; 429 return 0;
431} 430}
432 431
433static int s3c2410wdt_remove(struct device *dev) 432static int s3c2410wdt_remove(struct platform_device *dev)
434{ 433{
435 if (wdt_mem != NULL) { 434 if (wdt_mem != NULL) {
436 release_resource(wdt_mem); 435 release_resource(wdt_mem);
@@ -454,7 +453,7 @@ static int s3c2410wdt_remove(struct device *dev)
454 return 0; 453 return 0;
455} 454}
456 455
457static void s3c2410wdt_shutdown(struct device *dev) 456static void s3c2410wdt_shutdown(struct platform_device *dev)
458{ 457{
459 s3c2410wdt_stop(); 458 s3c2410wdt_stop();
460} 459}
@@ -464,7 +463,7 @@ static void s3c2410wdt_shutdown(struct device *dev)
464static unsigned long wtcon_save; 463static unsigned long wtcon_save;
465static unsigned long wtdat_save; 464static unsigned long wtdat_save;
466 465
467static int s3c2410wdt_suspend(struct device *dev, pm_message_t state) 466static int s3c2410wdt_suspend(struct platform_device *dev, pm_message_t state)
468{ 467{
469 /* Save watchdog state, and turn it off. */ 468 /* Save watchdog state, and turn it off. */
470 wtcon_save = readl(wdt_base + S3C2410_WTCON); 469 wtcon_save = readl(wdt_base + S3C2410_WTCON);
@@ -476,7 +475,7 @@ static int s3c2410wdt_suspend(struct device *dev, pm_message_t state)
476 return 0; 475 return 0;
477} 476}
478 477
479static int s3c2410wdt_resume(struct device *dev) 478static int s3c2410wdt_resume(struct platform_device *dev)
480{ 479{
481 /* Restore watchdog state. */ 480 /* Restore watchdog state. */
482 481
@@ -496,15 +495,16 @@ static int s3c2410wdt_resume(struct device *dev)
496#endif /* CONFIG_PM */ 495#endif /* CONFIG_PM */
497 496
498 497
499static struct device_driver s3c2410wdt_driver = { 498static struct platform_driver s3c2410wdt_driver = {
500 .owner = THIS_MODULE,
501 .name = "s3c2410-wdt",
502 .bus = &platform_bus_type,
503 .probe = s3c2410wdt_probe, 499 .probe = s3c2410wdt_probe,
504 .remove = s3c2410wdt_remove, 500 .remove = s3c2410wdt_remove,
505 .shutdown = s3c2410wdt_shutdown, 501 .shutdown = s3c2410wdt_shutdown,
506 .suspend = s3c2410wdt_suspend, 502 .suspend = s3c2410wdt_suspend,
507 .resume = s3c2410wdt_resume, 503 .resume = s3c2410wdt_resume,
504 .driver = {
505 .owner = THIS_MODULE,
506 .name = "s3c2410-wdt",
507 },
508}; 508};
509 509
510 510
@@ -513,12 +513,12 @@ static char banner[] __initdata = KERN_INFO "S3C2410 Watchdog Timer, (c) 2004 Si
513static int __init watchdog_init(void) 513static int __init watchdog_init(void)
514{ 514{
515 printk(banner); 515 printk(banner);
516 return driver_register(&s3c2410wdt_driver); 516 return platform_driver_register(&s3c2410wdt_driver);
517} 517}
518 518
519static void __exit watchdog_exit(void) 519static void __exit watchdog_exit(void)
520{ 520{
521 driver_unregister(&s3c2410wdt_driver); 521 platform_driver_unregister(&s3c2410wdt_driver);
522} 522}
523 523
524module_init(watchdog_init); 524module_init(watchdog_init);