From: Hans de Goede <hdegoede@redhat.com>
To: Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Which error code to return when a usb camera gets unplugged
Date: Mon, 06 Jun 2011 19:56:10 +0200 [thread overview]
Message-ID: <4DED14BA.5010306@redhat.com> (raw)
Hi,
While working on my cleanup / v4l2 compliance series for
the pwc driver I've noticed that the pwc and gspca drivers
are doing different things wrt what error they return to
an app is using the device while it gets unplugged.
gspca returns -ENODEV, where as pwc returns -EPIPE.
Both make some sense. I've not looked at what other
usb (or other hotplug capable bus) v4l2 drivers do, but
it makes sense to me to standardize on an error here,
preferably a reasonable unique one so that apps can
detect unplug versus other errors. Note that the usb
subsystem returns -ENODEV when you try to (re)submit
an urb from its completion handler, when that
completion handler gets called because the urb was
unlinked because of device unplug.
Given that we often return usb error codes unmodified
and the usb subsys uses -ENODEV for trying to do things
with unplugged devices, I guess it makes sense for
us to also use -ENODEV.
Regards,
Hans
next reply other threads:[~2011-06-06 17:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-06 17:56 Hans de Goede [this message]
2011-06-06 17:59 ` Which error code to return when a usb camera gets unplugged Devin Heitmueller
2011-06-06 21:48 ` Andy Walls
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=4DED14BA.5010306@redhat.com \
--to=hdegoede@redhat.com \
--cc=linux-media@vger.kernel.org \
/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