aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ov511.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-10-10 14:09:43 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-10-13 23:44:13 -0400
commit2444a2fca488fa8e362895a4ca9fdc51f497282a (patch)
tree05e4bcdc628f9825da6f027cb506728ad3649957 /drivers/media/video/ov511.c
parent474ce78130ba37cb50e620c538ab3ffe6c582ba6 (diff)
V4L/DVB (4741): {ov511,stv680}: handle sysfs errors
Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/ov511.c')
-rw-r--r--drivers/media/video/ov511.c58
1 files changed, 47 insertions, 11 deletions
diff --git a/drivers/media/video/ov511.c b/drivers/media/video/ov511.c
index ce4886f1528d..b4db2cbb5a84 100644
--- a/drivers/media/video/ov511.c
+++ b/drivers/media/video/ov511.c
@@ -5648,17 +5648,49 @@ static ssize_t show_exposure(struct class_device *cd, char *buf)
5648} 5648}
5649static CLASS_DEVICE_ATTR(exposure, S_IRUGO, show_exposure, NULL); 5649static CLASS_DEVICE_ATTR(exposure, S_IRUGO, show_exposure, NULL);
5650 5650
5651static void ov_create_sysfs(struct video_device *vdev) 5651static int ov_create_sysfs(struct video_device *vdev)
5652{ 5652{
5653 video_device_create_file(vdev, &class_device_attr_custom_id); 5653 int rc;
5654 video_device_create_file(vdev, &class_device_attr_model); 5654
5655 video_device_create_file(vdev, &class_device_attr_bridge); 5655 rc = video_device_create_file(vdev, &class_device_attr_custom_id);
5656 video_device_create_file(vdev, &class_device_attr_sensor); 5656 if (rc) goto err;
5657 video_device_create_file(vdev, &class_device_attr_brightness); 5657 rc = video_device_create_file(vdev, &class_device_attr_model);
5658 video_device_create_file(vdev, &class_device_attr_saturation); 5658 if (rc) goto err_id;
5659 video_device_create_file(vdev, &class_device_attr_contrast); 5659 rc = video_device_create_file(vdev, &class_device_attr_bridge);
5660 video_device_create_file(vdev, &class_device_attr_hue); 5660 if (rc) goto err_model;
5661 video_device_create_file(vdev, &class_device_attr_exposure); 5661 rc = video_device_create_file(vdev, &class_device_attr_sensor);
5662 if (rc) goto err_bridge;
5663 rc = video_device_create_file(vdev, &class_device_attr_brightness);
5664 if (rc) goto err_sensor;
5665 rc = video_device_create_file(vdev, &class_device_attr_saturation);
5666 if (rc) goto err_bright;
5667 rc = video_device_create_file(vdev, &class_device_attr_contrast);
5668 if (rc) goto err_sat;
5669 rc = video_device_create_file(vdev, &class_device_attr_hue);
5670 if (rc) goto err_contrast;
5671 rc = video_device_create_file(vdev, &class_device_attr_exposure);
5672 if (rc) goto err_hue;
5673
5674 return 0;
5675
5676err_hue:
5677 video_device_remove_file(vdev, &class_device_attr_hue);
5678err_contrast:
5679 video_device_remove_file(vdev, &class_device_attr_contrast);
5680err_sat:
5681 video_device_remove_file(vdev, &class_device_attr_saturation);
5682err_bright:
5683 video_device_remove_file(vdev, &class_device_attr_brightness);
5684err_sensor:
5685 video_device_remove_file(vdev, &class_device_attr_sensor);
5686err_bridge:
5687 video_device_remove_file(vdev, &class_device_attr_bridge);
5688err_model:
5689 video_device_remove_file(vdev, &class_device_attr_model);
5690err_id:
5691 video_device_remove_file(vdev, &class_device_attr_custom_id);
5692err:
5693 return rc;
5662} 5694}
5663 5695
5664/**************************************************************************** 5696/****************************************************************************
@@ -5817,7 +5849,11 @@ ov51x_probe(struct usb_interface *intf, const struct usb_device_id *id)
5817 ov->vdev->minor); 5849 ov->vdev->minor);
5818 5850
5819 usb_set_intfdata(intf, ov); 5851 usb_set_intfdata(intf, ov);
5820 ov_create_sysfs(ov->vdev); 5852 if (ov_create_sysfs(ov->vdev)) {
5853 err("ov_create_sysfs failed");
5854 goto error;
5855 }
5856
5821 return 0; 5857 return 0;
5822 5858
5823error: 5859error: