[WATCHDOG] fix watchdog/ixp4xx_wdt.c compilation
[pandora-kernel.git] / drivers / watchdog / ixp4xx_wdt.c
index 24e624c..8302ef0 100644 (file)
 #include <linux/watchdog.h>
 #include <linux/init.h>
 #include <linux/bitops.h>
-
-#include <asm/hardware.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
+#include <mach/hardware.h>
 
 static int nowayout = WATCHDOG_NOWAYOUT;
 static int heartbeat = 60;     /* (secs) Default is 1 minute */
 static unsigned long wdt_status;
 static unsigned long boot_status;
-static spin_lock_t wdt_lock;
+static DEFINE_SPINLOCK(wdt_lock);
 
 #define WDT_TICK_RATE (IXP4XX_PERIPHERAL_BUS_CLOCK * 1000000UL)
 
@@ -117,6 +116,11 @@ static long ixp4xx_wdt_ioctl(struct file *file, unsigned int cmd,
                ret = put_user(boot_status, (int *)arg);
                break;
 
+       case WDIOC_KEEPALIVE:
+               wdt_enable();
+               ret = 0;
+               break;
+
        case WDIOC_SETTIMEOUT:
                ret = get_user(time, (int *)arg);
                if (ret)
@@ -134,11 +138,6 @@ static long ixp4xx_wdt_ioctl(struct file *file, unsigned int cmd,
        case WDIOC_GETTIMEOUT:
                ret = put_user(heartbeat, (int *)arg);
                break;
-
-       case WDIOC_KEEPALIVE:
-               wdt_enable();
-               ret = 0;
-               break;
        }
        return ret;
 }
@@ -157,8 +156,7 @@ static int ixp4xx_wdt_release(struct inode *inode, struct file *file)
 }
 
 
-static const struct file_operations ixp4xx_wdt_fops =
-{
+static const struct file_operations ixp4xx_wdt_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = ixp4xx_wdt_write,
@@ -167,8 +165,7 @@ static const struct file_operations ixp4xx_wdt_fops =
        .release        = ixp4xx_wdt_release,
 };
 
-static struct miscdevice ixp4xx_wdt_miscdev =
-{
+static struct miscdevice ixp4xx_wdt_miscdev = {
        .minor          = WATCHDOG_MINOR,
        .name           = "watchdog",
        .fops           = &ixp4xx_wdt_fops,
@@ -181,8 +178,8 @@ static int __init ixp4xx_wdt_init(void)
 
        asm("mrc p15, 0, %0, cr0, cr0, 0;" : "=r"(processor_id) :);
        if (!(processor_id & 0xf) && !cpu_is_ixp46x()) {
-               printk("IXP4XXX Watchdog: Rev. A0 IXP42x CPU detected - "
-                       "watchdog disabled\n");
+               printk(KERN_ERR "IXP4XXX Watchdog: Rev. A0 IXP42x CPU detected"
+                       " - watchdog disabled\n");
 
                return -ENODEV;
        }
@@ -191,7 +188,8 @@ static int __init ixp4xx_wdt_init(void)
                        WDIOF_CARDRESET : 0;
        ret = misc_register(&ixp4xx_wdt_miscdev);
        if (ret == 0)
-               printk("IXP4xx Watchdog Timer: heartbeat %d sec\n", heartbeat);
+               printk(KERN_INFO "IXP4xx Watchdog Timer: heartbeat %d sec\n",
+                       heartbeat);
        return ret;
 }