X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fmedia%2Fvideo%2Fov511.c;h=b4db2cbb5a84246151e0d39ca589e7ceb50f915e;hb=refs%2Fheads%2Fvserver;hp=1b07a61c2ebb7dd98854e7d40dcea077189868cb;hpb=76828883507a47dae78837ab5dec5a5b4513c667;p=linux-2.6.git diff --git a/drivers/media/video/ov511.c b/drivers/media/video/ov511.c index 1b07a61c2..b4db2cbb5 100644 --- a/drivers/media/video/ov511.c +++ b/drivers/media/video/ov511.c @@ -301,10 +301,11 @@ static struct symbolic_list senlist[] = { static struct symbolic_list urb_errlist[] = { { -ENOSR, "Buffer error (overrun)" }, { -EPIPE, "Stalled (device not responding)" }, - { -EOVERFLOW, "Babble (bad cable?)" }, + { -EOVERFLOW, "Babble (device sends too much data)" }, { -EPROTO, "Bit-stuff error (bad cable?)" }, - { -EILSEQ, "CRC/Timeout" }, - { -ETIMEDOUT, "NAK (device does not respond)" }, + { -EILSEQ, "CRC/Timeout (bad cable?)" }, + { -ETIME, "Device does not respond to token" }, + { -ETIMEDOUT, "Device does not respond to command" }, { -1, NULL } }; @@ -3502,7 +3503,7 @@ check_middle: } static void -ov51x_isoc_irq(struct urb *urb, struct pt_regs *regs) +ov51x_isoc_irq(struct urb *urb) { int i; struct usb_ov511 *ov; @@ -5647,17 +5648,49 @@ static ssize_t show_exposure(struct class_device *cd, char *buf) } static CLASS_DEVICE_ATTR(exposure, S_IRUGO, show_exposure, NULL); -static void ov_create_sysfs(struct video_device *vdev) +static int ov_create_sysfs(struct video_device *vdev) { - video_device_create_file(vdev, &class_device_attr_custom_id); - video_device_create_file(vdev, &class_device_attr_model); - video_device_create_file(vdev, &class_device_attr_bridge); - video_device_create_file(vdev, &class_device_attr_sensor); - video_device_create_file(vdev, &class_device_attr_brightness); - video_device_create_file(vdev, &class_device_attr_saturation); - video_device_create_file(vdev, &class_device_attr_contrast); - video_device_create_file(vdev, &class_device_attr_hue); - video_device_create_file(vdev, &class_device_attr_exposure); + int rc; + + rc = video_device_create_file(vdev, &class_device_attr_custom_id); + if (rc) goto err; + rc = video_device_create_file(vdev, &class_device_attr_model); + if (rc) goto err_id; + rc = video_device_create_file(vdev, &class_device_attr_bridge); + if (rc) goto err_model; + rc = video_device_create_file(vdev, &class_device_attr_sensor); + if (rc) goto err_bridge; + rc = video_device_create_file(vdev, &class_device_attr_brightness); + if (rc) goto err_sensor; + rc = video_device_create_file(vdev, &class_device_attr_saturation); + if (rc) goto err_bright; + rc = video_device_create_file(vdev, &class_device_attr_contrast); + if (rc) goto err_sat; + rc = video_device_create_file(vdev, &class_device_attr_hue); + if (rc) goto err_contrast; + rc = video_device_create_file(vdev, &class_device_attr_exposure); + if (rc) goto err_hue; + + return 0; + +err_hue: + video_device_remove_file(vdev, &class_device_attr_hue); +err_contrast: + video_device_remove_file(vdev, &class_device_attr_contrast); +err_sat: + video_device_remove_file(vdev, &class_device_attr_saturation); +err_bright: + video_device_remove_file(vdev, &class_device_attr_brightness); +err_sensor: + video_device_remove_file(vdev, &class_device_attr_sensor); +err_bridge: + video_device_remove_file(vdev, &class_device_attr_bridge); +err_model: + video_device_remove_file(vdev, &class_device_attr_model); +err_id: + video_device_remove_file(vdev, &class_device_attr_custom_id); +err: + return rc; } /**************************************************************************** @@ -5816,7 +5849,11 @@ ov51x_probe(struct usb_interface *intf, const struct usb_device_id *id) ov->vdev->minor); usb_set_intfdata(intf, ov); - ov_create_sysfs(ov->vdev); + if (ov_create_sysfs(ov->vdev)) { + err("ov_create_sysfs failed"); + goto error; + } + return 0; error: