aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorWim Van Sebroeck <wim@iguana.be>2012-06-26 14:07:21 -0400
committerWim Van Sebroeck <wim@iguana.be>2012-06-28 14:40:56 -0400
commit8b9468d496abd357cc797b27a79d4402f5e0e94d (patch)
tree31e7d3ebbaf94183dc442cbc1628831d2b5cdc40 /drivers
parenta089361cf5f1d6a5295aa5385238bd044998e1e9 (diff)
watchdog: core: fix WDIOC_GETSTATUS return value
In commit 7a87982420e5e126bfefeb42232d1fd92052794e we added a wrapper for the WDIOC_GETSTATUS ioctl call. The code results however in a different behaviour: it returns an error if the driver doesn't support the status operation. This is not according to the API that says that when we don't support the status operation, that we just should return a 0 value. Only when the device isn't there anymore, we should return an error. Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/watchdog/watchdog_dev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c
index 672d169bf1da..ef8edecfc526 100644
--- a/drivers/watchdog/watchdog_dev.c
+++ b/drivers/watchdog/watchdog_dev.c
@@ -349,7 +349,7 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd,
349 sizeof(struct watchdog_info)) ? -EFAULT : 0; 349 sizeof(struct watchdog_info)) ? -EFAULT : 0;
350 case WDIOC_GETSTATUS: 350 case WDIOC_GETSTATUS:
351 err = watchdog_get_status(wdd, &val); 351 err = watchdog_get_status(wdd, &val);
352 if (err) 352 if (err == -ENODEV)
353 return err; 353 return err;
354 return put_user(val, p); 354 return put_user(val, p);
355 case WDIOC_GETBOOTSTATUS: 355 case WDIOC_GETBOOTSTATUS: