]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/watchdog/s3c2410_wdt.c
[WATCHDOG] sc1200wdt.c printk fix
[linux-2.6-omap-h63xx.git] / drivers / char / watchdog / s3c2410_wdt.c
index b732020acadb1962fa693d5346e97dec33c0acfa..9dc54736e4eb627d5e843bda4e2bc2a243aa0840 100644 (file)
 #include <linux/watchdog.h>
 #include <linux/fs.h>
 #include <linux/init.h>
-#include <linux/device.h>
+#include <linux/platform_device.h>
 #include <linux/interrupt.h>
+#include <linux/clk.h>
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
 
 #include <asm/arch/map.h>
-#include <asm/hardware/clock.h>
 
 #undef S3C24XX_VA_WATCHDOG
 #define S3C24XX_VA_WATCHDOG (0)
@@ -347,15 +347,14 @@ static irqreturn_t s3c2410wdt_irq(int irqno, void *param,
 }
 /* device interface */
 
-static int s3c2410wdt_probe(struct device *dev)
+static int s3c2410wdt_probe(struct platform_device *pdev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
        struct resource *res;
        int started = 0;
        int ret;
        int size;
 
-       DBG("%s: probe=%p, device=%p\n", __FUNCTION__, pdev, dev);
+       DBG("%s: probe=%p\n", __FUNCTION__, pdev);
 
        /* get the memory region for the watchdog timer */
 
@@ -386,19 +385,18 @@ static int s3c2410wdt_probe(struct device *dev)
                return -ENOENT;
        }
 
-       ret = request_irq(res->start, s3c2410wdt_irq, 0, pdev->name, dev);
+       ret = request_irq(res->start, s3c2410wdt_irq, 0, pdev->name, pdev);
        if (ret != 0) {
                printk(KERN_INFO PFX "failed to install irq (%d)\n", ret);
                return ret;
        }
 
-       wdt_clock = clk_get(dev, "watchdog");
+       wdt_clock = clk_get(&pdev->dev, "watchdog");
        if (wdt_clock == NULL) {
                printk(KERN_INFO PFX "failed to find watchdog clock source\n");
                return -ENOENT;
        }
 
-       clk_use(wdt_clock);
        clk_enable(wdt_clock);
 
        /* see if we can actually set the requested timer margin, and if
@@ -430,7 +428,7 @@ static int s3c2410wdt_probe(struct device *dev)
        return 0;
 }
 
-static int s3c2410wdt_remove(struct device *dev)
+static int s3c2410wdt_remove(struct platform_device *dev)
 {
        if (wdt_mem != NULL) {
                release_resource(wdt_mem);
@@ -445,7 +443,6 @@ static int s3c2410wdt_remove(struct device *dev)
 
        if (wdt_clock != NULL) {
                clk_disable(wdt_clock);
-               clk_unuse(wdt_clock);
                clk_put(wdt_clock);
                wdt_clock = NULL;
        }
@@ -454,7 +451,7 @@ static int s3c2410wdt_remove(struct device *dev)
        return 0;
 }
 
-static void s3c2410wdt_shutdown(struct device *dev)
+static void s3c2410wdt_shutdown(struct platform_device *dev)
 {
        s3c2410wdt_stop();      
 }
@@ -464,7 +461,7 @@ static void s3c2410wdt_shutdown(struct device *dev)
 static unsigned long wtcon_save;
 static unsigned long wtdat_save;
 
-static int s3c2410wdt_suspend(struct device *dev, pm_message_t state)
+static int s3c2410wdt_suspend(struct platform_device *dev, pm_message_t state)
 {
        /* Save watchdog state, and turn it off. */
        wtcon_save = readl(wdt_base + S3C2410_WTCON);
@@ -476,7 +473,7 @@ static int s3c2410wdt_suspend(struct device *dev, pm_message_t state)
        return 0;
 }
 
-static int s3c2410wdt_resume(struct device *dev)
+static int s3c2410wdt_resume(struct platform_device *dev)
 {
        /* Restore watchdog state. */
 
@@ -496,14 +493,16 @@ static int s3c2410wdt_resume(struct device *dev)
 #endif /* CONFIG_PM */
 
 
-static struct device_driver s3c2410wdt_driver = {
-       .name           = "s3c2410-wdt",
-       .bus            = &platform_bus_type,
+static struct platform_driver s3c2410wdt_driver = {
        .probe          = s3c2410wdt_probe,
        .remove         = s3c2410wdt_remove,
        .shutdown       = s3c2410wdt_shutdown,
        .suspend        = s3c2410wdt_suspend,
        .resume         = s3c2410wdt_resume,
+       .driver         = {
+               .owner  = THIS_MODULE,
+               .name   = "s3c2410-wdt",
+       },
 };
 
 
@@ -512,12 +511,12 @@ static char banner[] __initdata = KERN_INFO "S3C2410 Watchdog Timer, (c) 2004 Si
 static int __init watchdog_init(void)
 {
        printk(banner);
-       return driver_register(&s3c2410wdt_driver);
+       return platform_driver_register(&s3c2410wdt_driver);
 }
 
 static void __exit watchdog_exit(void)
 {
-       driver_unregister(&s3c2410wdt_driver);
+       platform_driver_unregister(&s3c2410wdt_driver);
 }
 
 module_init(watchdog_init);