aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/stv680.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-10-15 11:01:53 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-15 11:01:53 -0700
commited75ded7dd3fdb647df4efefc5d11158e3d182be (patch)
treeb1deddc70e76c03c1416add83c90160cefc5ac6f /drivers/media/video/stv680.c
parente5a301ee02e53acf000bb8331587129930bc2290 (diff)
parent5570dd02ca7fb2e28d32516fae05031d48711aa5 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb: V4L/DVB (4750): AGC command1/2 is board specific V4L/DVB (4748): Fixed oops for Nova-T USB2 V4L/DVB (4746): HM12 is YUV 4:2:0, not YUV 4:1:1 V4L/DVB (4744): The Samsung TCPN2121P30A does not have a tda9887 V4L/DVB (4743): Fix oops in VIDIOC_G_PARM V4L/DVB (4742): Drivers/media/video: handle sysfs errors V4L/DVB (4741): {ov511,stv680}: handle sysfs errors V4L/DVB (4740): Fixed an if-block to avoid floating with debug-messages V4L/DVB (4739): SECAM support for saa7113 into saa7115 V4L/DVB (4738): Bt8xx/dvb-bt8xx.c: check kmalloc() return value. V4L/DVB (4734): Tda826x: fix frontend selection for dvb_attach V4L/DVB (4733): Tda10086: fix frontend selection for dvb_attach V4L/DVB (4732): Fix spelling error in Kconfig help text for DVB_CORE_ATTACH V4L/DVB (4731a): Kconfig: restore pvrusb2 menu items V4L/DVB (4729): Fix VIDIOC_G_FMT for NTSC in cx25840. V4L/DVB (4727): Support status readout for saa713x based FM radio V4L/DVB (4725): Fix vivi compile on parisc V4L/DVB (4692): Add WinTV-HVR3000 DVB-T support
Diffstat (limited to 'drivers/media/video/stv680.c')
-rw-r--r--drivers/media/video/stv680.c53
1 files changed, 43 insertions, 10 deletions
diff --git a/drivers/media/video/stv680.c b/drivers/media/video/stv680.c
index 87e11300181..6d1ef1e2e8e 100644
--- a/drivers/media/video/stv680.c
+++ b/drivers/media/video/stv680.c
@@ -516,16 +516,45 @@ stv680_file(frames_read, framecount, "%d\n");
stv680_file(packets_dropped, dropped, "%d\n");
stv680_file(decoding_errors, error, "%d\n");
-static void stv680_create_sysfs_files(struct video_device *vdev)
+static int stv680_create_sysfs_files(struct video_device *vdev)
{
- video_device_create_file(vdev, &class_device_attr_model);
- video_device_create_file(vdev, &class_device_attr_in_use);
- video_device_create_file(vdev, &class_device_attr_streaming);
- video_device_create_file(vdev, &class_device_attr_palette);
- video_device_create_file(vdev, &class_device_attr_frames_total);
- video_device_create_file(vdev, &class_device_attr_frames_read);
- video_device_create_file(vdev, &class_device_attr_packets_dropped);
- video_device_create_file(vdev, &class_device_attr_decoding_errors);
+ int rc;
+
+ rc = video_device_create_file(vdev, &class_device_attr_model);
+ if (rc) goto err;
+ rc = video_device_create_file(vdev, &class_device_attr_in_use);
+ if (rc) goto err_model;
+ rc = video_device_create_file(vdev, &class_device_attr_streaming);
+ if (rc) goto err_inuse;
+ rc = video_device_create_file(vdev, &class_device_attr_palette);
+ if (rc) goto err_stream;
+ rc = video_device_create_file(vdev, &class_device_attr_frames_total);
+ if (rc) goto err_pal;
+ rc = video_device_create_file(vdev, &class_device_attr_frames_read);
+ if (rc) goto err_framtot;
+ rc = video_device_create_file(vdev, &class_device_attr_packets_dropped);
+ if (rc) goto err_framread;
+ rc = video_device_create_file(vdev, &class_device_attr_decoding_errors);
+ if (rc) goto err_dropped;
+
+ return 0;
+
+err_dropped:
+ video_device_remove_file(vdev, &class_device_attr_packets_dropped);
+err_framread:
+ video_device_remove_file(vdev, &class_device_attr_frames_read);
+err_framtot:
+ video_device_remove_file(vdev, &class_device_attr_frames_total);
+err_pal:
+ video_device_remove_file(vdev, &class_device_attr_palette);
+err_stream:
+ video_device_remove_file(vdev, &class_device_attr_streaming);
+err_inuse:
+ video_device_remove_file(vdev, &class_device_attr_in_use);
+err_model:
+ video_device_remove_file(vdev, &class_device_attr_model);
+err:
+ return rc;
}
static void stv680_remove_sysfs_files(struct video_device *vdev)
@@ -1418,9 +1447,13 @@ static int stv680_probe (struct usb_interface *intf, const struct usb_device_id
PDEBUG (0, "STV(i): registered new video device: video%d", stv680->vdev->minor);
usb_set_intfdata (intf, stv680);
- stv680_create_sysfs_files(stv680->vdev);
+ retval = stv680_create_sysfs_files(stv680->vdev);
+ if (retval)
+ goto error_unreg;
return 0;
+error_unreg:
+ video_unregister_device(stv680->vdev);
error_vdev:
video_device_release(stv680->vdev);
error: