Skip to content

Commit

Permalink
[WATCHDOG] davinci_wdt clean-up
Browse files Browse the repository at this point in the history
* Remove the redundant check for pwrite(), given that the open() routine
  already invokes nonseekable_open().
* The WDIOF_CARDRESET flag can only be used when you can read this status
  via the WDIOC_GETSTATUS ioctl call.
* Add the mandatory WDIOC_GETBOOTSTATUS ioctl call.

Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
  • Loading branch information
Wim Van Sebroeck committed Jul 23, 2007
1 parent de81225 commit f1a08cc
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/char/watchdog/davinci_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,14 @@ static ssize_t
davinci_wdt_write(struct file *file, const char *data, size_t len,
loff_t *ppos)
{
/* Can't seek (pwrite) on this device */
if (ppos != &file->f_pos)
return -ESPIPE;

if (len)
wdt_service();

return len;
}

static struct watchdog_info ident = {
.options = WDIOF_CARDRESET | WDIOF_KEEPALIVEPING,
.options = WDIOF_KEEPALIVEPING,
.identity = "DaVinci Watchdog",
};

Expand All @@ -160,6 +156,7 @@ davinci_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
break;

case WDIOC_GETSTATUS:
case WDIOC_GETBOOTSTATUS:
ret = put_user(0, (int *)arg);
break;

Expand Down

0 comments on commit f1a08cc

Please sign in to comment.