public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* Which error code to return when a usb camera gets unplugged
@ 2011-06-06 17:56 Hans de Goede
  2011-06-06 17:59 ` Devin Heitmueller
  0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2011-06-06 17:56 UTC (permalink / raw)
  To: Linux Media Mailing List

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

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

end of thread, other threads:[~2011-06-06 21:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-06 17:56 Which error code to return when a usb camera gets unplugged Hans de Goede
2011-06-06 17:59 ` Devin Heitmueller
2011-06-06 21:48   ` Andy Walls

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