All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usbhid: replace inappropriate ENOSYS with ENODEV
@ 2016-01-20 21:56 Heiner Kallweit
  2016-01-21 14:18 ` Jiri Kosina
  0 siblings, 1 reply; 5+ messages in thread
From: Heiner Kallweit @ 2016-01-20 21:56 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-input

Primary meaning of ENOSYS is "system call not available" but it's also used
with meaning "function not implemented". Both are not applicable here.

Typically this error occurs when the device was unplugged.
usbhid_raw_request returns -ENODEV in such a case what seems to be more
reasonable. Therefore use -ENODEV also here.

Primary motivation for this change is a change in the LED subsystem to
ignore -ENODEV if the device was most likely unplugged.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/hid/usbhid/hid-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index ad71160..64a8d9c 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -928,7 +928,7 @@ static int usbhid_output_report(struct hid_device *hid, __u8 *buf, size_t count)
 	int actual_length, skipped_report_id = 0, ret;
 
 	if (!usbhid->urbout)
-		return -ENOSYS;
+		return -ENODEV;
 
 	if (buf[0] == 0x0) {
 		/* Don't send the Report ID */
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-01-22 23:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-20 21:56 [PATCH] usbhid: replace inappropriate ENOSYS with ENODEV Heiner Kallweit
2016-01-21 14:18 ` Jiri Kosina
2016-01-21 17:42   ` Dmitry Torokhov
2016-01-22 23:30     ` Jiri Kosina
2016-01-22 23:35       ` Andy Lutomirski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.