From: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
To: linux-kernel@vger.kernel.org
Cc: alan@lxorguk.ukuu.org.uk, gregkh@suse.de,
linux-usb@vger.kernel.org, oliver@neukum.name,
Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Subject: [PATCH 1/3] Return ENODEV instead of EINVAL when trying to open ACM device.
Date: Wed, 24 Jun 2009 18:33:29 -0300 [thread overview]
Message-ID: <1245879211-10130-1-git-send-email-cascardo@holoscopio.com> (raw)
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
next reply other threads:[~2009-06-24 21:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-24 21:33 Thadeu Lima de Souza Cascardo [this message]
2009-06-24 21:33 ` [PATCH 2/3] Fix oops when closing ACM tty device right after open has failed Thadeu Lima de Souza Cascardo
2009-06-24 21:32 ` Greg KH
2009-06-24 21:33 ` [PATCH 3/3] Fix oops when unexisting usb serial device is opened Thadeu Lima de Souza Cascardo
-- strict thread matches above, loose matches on Subject: below --
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 20:40 ` Greg KH
2009-06-24 21:17 ` Oliver Neukum
2009-06-24 21:19 ` Thadeu Lima de Souza Cascardo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1245879211-10130-1-git-send-email-cascardo@holoscopio.com \
--to=cascardo@holoscopio.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=oliver@neukum.name \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®