X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fwatchdog%2Fmpc5200_wdt.c;h=ce1811d5d6b18816976086373af52038960ac6c2;hb=9e74114d96bb5dbaa17b9292139b0c6205e0b971;hp=9cfb9757662361cb64b770764aa1fa66a4be29f8;hpb=ab08ed1770140ebcf1be1657087689832b755874;p=linux-2.6 diff --git a/drivers/watchdog/mpc5200_wdt.c b/drivers/watchdog/mpc5200_wdt.c index 9cfb975766..ce1811d5d6 100644 --- a/drivers/watchdog/mpc5200_wdt.c +++ b/drivers/watchdog/mpc5200_wdt.c @@ -4,8 +4,8 @@ #include #include #include -#include -#include +#include +#include #include @@ -57,7 +57,8 @@ static int mpc5200_wdt_start(struct mpc5200_wdt *wdt) /* set timeout, with maximum prescaler */ out_be32(&wdt->regs->count, 0x0 | wdt->count); /* enable watchdog */ - out_be32(&wdt->regs->mode, GPT_MODE_CE | GPT_MODE_WDT | GPT_MODE_MS_TIMER); + out_be32(&wdt->regs->mode, GPT_MODE_CE | GPT_MODE_WDT | + GPT_MODE_MS_TIMER); spin_unlock(&wdt->io_lock); return 0; @@ -66,7 +67,8 @@ static int mpc5200_wdt_ping(struct mpc5200_wdt *wdt) { spin_lock(&wdt->io_lock); /* writing A5 to OCPW resets the watchdog */ - out_be32(&wdt->regs->mode, 0xA5000000 | (0xffffff & in_be32(&wdt->regs->mode))); + out_be32(&wdt->regs->mode, 0xA5000000 | + (0xffffff & in_be32(&wdt->regs->mode))); spin_unlock(&wdt->io_lock); return 0; } @@ -92,8 +94,8 @@ static struct watchdog_info mpc5200_wdt_info = { .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, .identity = "mpc5200 watchdog on GPT0", }; -static int mpc5200_wdt_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) +static long mpc5200_wdt_ioctl(struct file *file, unsigned int cmd, + unsigned long arg) { struct mpc5200_wdt *wdt = file->private_data; int __user *data = (int __user *)arg; @@ -103,7 +105,7 @@ static int mpc5200_wdt_ioctl(struct inode *inode, struct file *file, switch (cmd) { case WDIOC_GETSUPPORT: ret = copy_to_user(data, &mpc5200_wdt_info, - sizeof(mpc5200_wdt_info)); + sizeof(mpc5200_wdt_info)); if (ret) ret = -EFAULT; break; @@ -135,6 +137,7 @@ static int mpc5200_wdt_ioctl(struct inode *inode, struct file *file, } return ret; } + static int mpc5200_wdt_open(struct inode *inode, struct file *file) { /* /dev/watchdog can only be opened once */ @@ -158,7 +161,7 @@ static int mpc5200_wdt_release(struct inode *inode, struct file *file) return 0; } -static struct file_operations mpc5200_wdt_fops = { +static const struct file_operations mpc5200_wdt_fops = { .owner = THIS_MODULE, .write = mpc5200_wdt_write, .ioctl = mpc5200_wdt_ioctl, @@ -167,7 +170,8 @@ static struct file_operations mpc5200_wdt_fops = { }; /* module operations */ -static int mpc5200_wdt_probe(struct of_device *op, const struct of_device_id *match) +static int mpc5200_wdt_probe(struct of_device *op, + const struct of_device_id *match) { struct mpc5200_wdt *wdt; int err; @@ -175,6 +179,8 @@ static int mpc5200_wdt_probe(struct of_device *op, const struct of_device_id *ma int size; has_wdt = of_get_property(op->node, "has-wdt", NULL); + if (!has_wdt) + has_wdt = of_get_property(op->node, "fsl,has-wdt", NULL); if (!has_wdt) return -ENODEV; @@ -254,6 +260,7 @@ static int mpc5200_wdt_shutdown(struct of_device *op) static struct of_device_id mpc5200_wdt_match[] = { { .compatible = "mpc5200-gpt", }, + { .compatible = "fsl,mpc5200-gpt", }, {}, }; static struct of_platform_driver mpc5200_wdt_driver = {