X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fwatchdog%2Fpnx4008_wdt.c;h=56dee3bfd4aa24ecef18c2305001ed62b7579999;hb=cb55d282a0d2156e7d40ee81726ab16b569e96d7;hp=22f8873dd092e72f5e25140eea95146ed817f4f1;hpb=4fa4d23fa20de67df919030c1216295664866ad7;p=linux-2.6 diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c index 22f8873dd0..56dee3bfd4 100644 --- a/drivers/watchdog/pnx4008_wdt.c +++ b/drivers/watchdog/pnx4008_wdt.c @@ -28,10 +28,10 @@ #include #include #include +#include +#include #include -#include -#include #define MODULE_NAME "PNX4008-WDT: " @@ -80,7 +80,7 @@ static int nowayout = WATCHDOG_NOWAYOUT; static int heartbeat = DEFAULT_HEARTBEAT; -static spinlock_t io_lock; +static DEFINE_SPINLOCK(io_lock); static unsigned long wdt_status; #define WDT_IN_USE 0 #define WDT_OK_TO_CLOSE 1 @@ -144,9 +144,8 @@ static int pnx4008_wdt_open(struct inode *inode, struct file *file) return nonseekable_open(inode, file); } -static ssize_t -pnx4008_wdt_write(struct file *file, const char *data, size_t len, - loff_t * ppos) +static ssize_t pnx4008_wdt_write(struct file *file, const char *data, + size_t len, loff_t *ppos) { if (len) { if (!nowayout) { @@ -169,15 +168,14 @@ pnx4008_wdt_write(struct file *file, const char *data, size_t len, return len; } -static struct watchdog_info ident = { +static const struct watchdog_info ident = { .options = WDIOF_CARDRESET | WDIOF_MAGICCLOSE | WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, .identity = "PNX4008 Watchdog", }; -static int -pnx4008_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, - unsigned long arg) +static long pnx4008_wdt_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) { int ret = -ENOTTY; int time; @@ -238,7 +236,7 @@ static const struct file_operations pnx4008_wdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = pnx4008_wdt_write, - .ioctl = pnx4008_wdt_ioctl, + .unlocked_ioctl = pnx4008_wdt_ioctl, .open = pnx4008_wdt_open, .release = pnx4008_wdt_release, }; @@ -254,8 +252,6 @@ static int pnx4008_wdt_probe(struct platform_device *pdev) int ret = 0, size; struct resource *res; - spin_lock_init(&io_lock); - if (heartbeat < 1 || heartbeat > MAX_HEARTBEAT) heartbeat = DEFAULT_HEARTBEAT; @@ -323,6 +319,7 @@ static int pnx4008_wdt_remove(struct platform_device *pdev) static struct platform_driver platform_wdt_driver = { .driver = { .name = "watchdog", + .owner = THIS_MODULE, }, .probe = pnx4008_wdt_probe, .remove = pnx4008_wdt_remove, @@ -335,7 +332,7 @@ static int __init pnx4008_wdt_init(void) static void __exit pnx4008_wdt_exit(void) { - return platform_driver_unregister(&platform_wdt_driver); + platform_driver_unregister(&platform_wdt_driver); } module_init(pnx4008_wdt_init); @@ -356,3 +353,4 @@ MODULE_PARM_DESC(nowayout, MODULE_LICENSE("GPL"); MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); +MODULE_ALIAS("platform:watchdog");