public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] Return ENODEV instead of EINVAL when trying to open ACM device.
@ 2009-06-24 11:31 Thadeu Lima de Souza Cascardo
  2009-06-24 11:31 ` [PATCH 2/3] Fix oops when closing ACM tty device right after open has failed Thadeu Lima de Souza Cascardo
  2009-06-24 20:40 ` [PATCH 1/3] Return ENODEV instead of EINVAL when trying to open ACM device Greg KH
  0 siblings, 2 replies; 11+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2009-06-24 11:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: alan, gregkh, linux-usb, oliver, Thadeu Lima de Souza Cascardo

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
---
 drivers/usb/class/cdc-acm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 38bfdb0..02eb60b 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -550,7 +550,7 @@ static void acm_waker(struct work_struct *waker)
 static int acm_tty_open(struct tty_struct *tty, struct file *filp)
 {
 	struct acm *acm;
-	int rv = -EINVAL;
+	int rv = -ENODEV;
 	int i;
 	dbg("Entering acm_tty_open.");
 
-- 
1.6.3


^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [PATCH 1/3] Return ENODEV instead of EINVAL when trying to open ACM device.
@ 2009-06-24 21:33 Thadeu Lima de Souza Cascardo
  0 siblings, 0 replies; 11+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2009-06-24 21:33 UTC (permalink / raw)
  To: linux-kernel
  Cc: alan, gregkh, linux-usb, oliver, Thadeu Lima de Souza Cascardo

This is required, otherwise a user will get a EINVAL while opening a
non-existing device, instead of ENODEV.

This is what I get with this patch applied now instead of an "Invalid
argument".

cascardo@vespa:~$ cat /dev/ttyACM0
cat: /dev/ttyACM0: No such device
cascardo@vespa:~$

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
---
 drivers/usb/class/cdc-acm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 38bfdb0..02eb60b 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -550,7 +550,7 @@ static void acm_waker(struct work_struct *waker)
 static int acm_tty_open(struct tty_struct *tty, struct file *filp)
 {
 	struct acm *acm;
-	int rv = -EINVAL;
+	int rv = -ENODEV;
 	int i;
 	dbg("Entering acm_tty_open.");
 
-- 
1.6.3


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

end of thread, other threads:[~2009-06-24 21:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-24 11:31 [PATCH 1/3] Return ENODEV instead of EINVAL when trying to open ACM device Thadeu Lima de Souza Cascardo
2009-06-24 11:31 ` [PATCH 2/3] Fix oops when closing ACM tty device right after open has failed Thadeu Lima de Souza Cascardo
2009-06-24 11:31   ` [PATCH 3/3] Fix oops when unexisting usb serial device is opened Thadeu Lima de Souza Cascardo
2009-06-24 20:41     ` Greg KH
2009-06-24 20:41   ` [PATCH 2/3] Fix oops when closing ACM tty device right after open has failed Greg KH
2009-06-24 21:35     ` Thadeu Lima de Souza Cascardo
2009-06-24 21:37       ` Greg KH
2009-06-24 20:40 ` [PATCH 1/3] Return ENODEV instead of EINVAL when trying to open ACM device Greg KH
2009-06-24 21:17   ` Oliver Neukum
2009-06-24 21:19     ` Thadeu Lima de Souza Cascardo
  -- strict thread matches above, loose matches on Subject: below --
2009-06-24 21:33 Thadeu Lima de Souza Cascardo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox