Hello,

I debugged a bug[1] I was having with Motion and noticed that the UVC
driver doesn't return an error when doing an ioctl() on a disconnected
device. Wouldn't ENODEV be a sensible value to return in such
situations? 

Anyway, this small patch adds a check in the beginning of
uvc_v4l2_do_ioctl(). With the patch Motion works with me as it seems to
work with the pwc driver. 

1:
http://www.lavrsen.dk/twiki/bin/view/Motion/BugReport2008x05x17x175521

Index: uvc_v4l2.c
===================================================================
--- uvc_v4l2.c	(revision 211)
+++ uvc_v4l2.c	(working copy)
@@ -479,6 +479,10 @@
 	if (uvc_trace_param & UVC_TRACE_IOCTL)
 		v4l_printk_ioctl(cmd);
 
+	if (video->dev->state & UVC_DEV_DISCONNECTED) {
+		return -ENODEV;
+	}
+
 	switch (cmd) {
 	/* Query capabilities */
 	case VIDIOC_QUERYCAP:
_______________________________________________
Linux-uvc-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel

Reply via email to