Which error code to return when a usb camera gets unplugged

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux