Skip to content

Commit 8b9468d

Browse files
author
Wim Van Sebroeck
committed
watchdog: core: fix WDIOC_GETSTATUS return value
In commit 7a87982 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 <[email protected]>
1 parent a089361 commit 8b9468d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/watchdog/watchdog_dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd,
349349
sizeof(struct watchdog_info)) ? -EFAULT : 0;
350350
case WDIOC_GETSTATUS:
351351
err = watchdog_get_status(wdd, &val);
352-
if (err)
352+
if (err == -ENODEV)
353353
return err;
354354
return put_user(val, p);
355355
case WDIOC_GETBOOTSTATUS:

0 commit comments

Comments
 (0)