提交 42dd2aa6 编写于 作者: T Thadeu Lima de Souza Cascardo 提交者: Linus Torvalds

acm: Return ENODEV instead of EINVAL when trying to open ACM device.

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: NThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: NAlan Cox <alan@linux.intel.com>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 a37f6b84
...@@ -550,7 +550,7 @@ static void acm_waker(struct work_struct *waker) ...@@ -550,7 +550,7 @@ static void acm_waker(struct work_struct *waker)
static int acm_tty_open(struct tty_struct *tty, struct file *filp) static int acm_tty_open(struct tty_struct *tty, struct file *filp)
{ {
struct acm *acm; struct acm *acm;
int rv = -EINVAL; int rv = -ENODEV;
int i; int i;
dbg("Entering acm_tty_open."); dbg("Entering acm_tty_open.");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册