[patch 23/28] USB: usbfs: fix -ENOENT error code to be -ENODEV

Greg KH
2009-08-13T19:50:09Z

[-- Attachment #1: usb-usbfs-fix-enoent-error-code-to-be-enodev.patch --]
[-- Type: text/plain, Size: 881 bytes --]

2.6.27-stable review patch. If anyone has any objections, please let us know.

------------------

From: Alan Stern <stern@rowland.harvard.edu>

commit 01105a246345f011fde64d24a601090b646e9e4c upstream.

This patch (as1272) changes the error code returned when an open call
for a USB device node fails to locate the corresponding device. The
appropriate error code is -ENODEV, not -ENOENT.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
drivers/usb/core/devio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -579,7 +579,7 @@ static int usbdev_open(struct inode *ino
if (!ps)
goto out;

- ret = -ENOENT;
+ ret = -ENODEV;

/* usbdev device-node */
if (imajor(inode) == USB_DEVICE_MAJOR)