aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/et61x251/et61x251_core.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/et61x251/et61x251_core.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/et61x251/et61x251_core.c')
-rw-r--r--drivers/media/video/et61x251/et61x251_core.c37
1 files changed, 31 insertions, 6 deletions
diff --git a/drivers/media/video/et61x251/et61x251_core.c b/drivers/media/video/et61x251/et61x251_core.c
index bc544cc7ccb..f786ab11d2c 100644
--- a/drivers/media/video/et61x251/et61x251_core.c
+++ b/drivers/media/video/et61x251/et61x251_core.c
@@ -973,16 +973,32 @@ static CLASS_DEVICE_ATTR(i2c_val, S_IRUGO | S_IWUSR,
et61x251_show_i2c_val, et61x251_store_i2c_val);
-static void et61x251_create_sysfs(struct et61x251_device* cam)
+static int et61x251_create_sysfs(struct et61x251_device* cam)
{
struct video_device *v4ldev = cam->v4ldev;
+ int rc;
- video_device_create_file(v4ldev, &class_device_attr_reg);
- video_device_create_file(v4ldev, &class_device_attr_val);
+ rc = video_device_create_file(v4ldev, &class_device_attr_reg);
+ if (rc) goto err;
+ rc = video_device_create_file(v4ldev, &class_device_attr_val);
+ if (rc) goto err_reg;
if (cam->sensor.sysfs_ops) {
- video_device_create_file(v4ldev, &class_device_attr_i2c_reg);
- video_device_create_file(v4ldev, &class_device_attr_i2c_val);
+ rc = video_device_create_file(v4ldev, &class_device_attr_i2c_reg);
+ if (rc) goto err_val;
+ rc = video_device_create_file(v4ldev, &class_device_attr_i2c_val);
+ if (rc) goto err_i2c_reg;
}
+
+ return 0;
+
+err_i2c_reg:
+ video_device_remove_file(v4ldev, &class_device_attr_i2c_reg);
+err_val:
+ video_device_remove_file(v4ldev, &class_device_attr_val);
+err_reg:
+ video_device_remove_file(v4ldev, &class_device_attr_reg);
+err:
+ return rc;
}
#endif /* CONFIG_VIDEO_ADV_DEBUG */
@@ -2534,7 +2550,9 @@ et61x251_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
dev_nr = (dev_nr < ET61X251_MAX_DEVICES-1) ? dev_nr+1 : 0;
#ifdef CONFIG_VIDEO_ADV_DEBUG
- et61x251_create_sysfs(cam);
+ err = et61x251_create_sysfs(cam);
+ if (err)
+ goto fail2;
DBG(2, "Optional device control through 'sysfs' interface ready");
#endif
@@ -2544,6 +2562,13 @@ et61x251_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
return 0;
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+fail2:
+ video_nr[dev_nr] = -1;
+ dev_nr = (dev_nr < ET61X251_MAX_DEVICES-1) ? dev_nr+1 : 0;
+ mutex_unlock(&cam->dev_mutex);
+ video_unregister_device(cam->v4ldev);
+#endif
fail:
if (cam) {
kfree(cam->control_buffer);