From 22a04f106346c3af019135f2de3cabf9ac41c3ba Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 20 Jul 2008 06:35:02 -0300 Subject: V4L/DVB (8429): videodev: renamed 'class_dev' to 'dev' The class_dev field is a normal device, not a class device. This is very confusing and now that the old 'dev' field has been renamed to 'parent' we can rename 'class_dev' to just 'dev'. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/sn9c102/sn9c102_core.c | 60 +++++++++++++----------------- 1 file changed, 25 insertions(+), 35 deletions(-) (limited to 'drivers/media/video/sn9c102/sn9c102_core.c') diff --git a/drivers/media/video/sn9c102/sn9c102_core.c b/drivers/media/video/sn9c102/sn9c102_core.c index 7f9c7bcf3c8..475b7819115 100644 --- a/drivers/media/video/sn9c102/sn9c102_core.c +++ b/drivers/media/video/sn9c102/sn9c102_core.c @@ -1038,8 +1038,7 @@ static ssize_t sn9c102_show_reg(struct device* cd, if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) return -ERESTARTSYS; - cam = video_get_drvdata(container_of(cd, struct video_device, - class_dev)); + cam = video_get_drvdata(container_of(cd, struct video_device, dev)); if (!cam) { mutex_unlock(&sn9c102_sysfs_lock); return -ENODEV; @@ -1064,8 +1063,7 @@ sn9c102_store_reg(struct device* cd, struct device_attribute *attr, if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) return -ERESTARTSYS; - cam = video_get_drvdata(container_of(cd, struct video_device, - class_dev)); + cam = video_get_drvdata(container_of(cd, struct video_device, dev)); if (!cam) { mutex_unlock(&sn9c102_sysfs_lock); return -ENODEV; @@ -1098,8 +1096,7 @@ static ssize_t sn9c102_show_val(struct device* cd, if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) return -ERESTARTSYS; - cam = video_get_drvdata(container_of(cd, struct video_device, - class_dev)); + cam = video_get_drvdata(container_of(cd, struct video_device, dev)); if (!cam) { mutex_unlock(&sn9c102_sysfs_lock); return -ENODEV; @@ -1132,8 +1129,7 @@ sn9c102_store_val(struct device* cd, struct device_attribute *attr, if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) return -ERESTARTSYS; - cam = video_get_drvdata(container_of(cd, struct video_device, - class_dev)); + cam = video_get_drvdata(container_of(cd, struct video_device, dev)); if (!cam) { mutex_unlock(&sn9c102_sysfs_lock); return -ENODEV; @@ -1170,8 +1166,7 @@ static ssize_t sn9c102_show_i2c_reg(struct device* cd, if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) return -ERESTARTSYS; - cam = video_get_drvdata(container_of(cd, struct video_device, - class_dev)); + cam = video_get_drvdata(container_of(cd, struct video_device, dev)); if (!cam) { mutex_unlock(&sn9c102_sysfs_lock); return -ENODEV; @@ -1198,8 +1193,7 @@ sn9c102_store_i2c_reg(struct device* cd, struct device_attribute *attr, if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) return -ERESTARTSYS; - cam = video_get_drvdata(container_of(cd, struct video_device, - class_dev)); + cam = video_get_drvdata(container_of(cd, struct video_device, dev)); if (!cam) { mutex_unlock(&sn9c102_sysfs_lock); return -ENODEV; @@ -1232,8 +1226,7 @@ static ssize_t sn9c102_show_i2c_val(struct device* cd, if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) return -ERESTARTSYS; - cam = video_get_drvdata(container_of(cd, struct video_device, - class_dev)); + cam = video_get_drvdata(container_of(cd, struct video_device, dev)); if (!cam) { mutex_unlock(&sn9c102_sysfs_lock); return -ENODEV; @@ -1271,8 +1264,7 @@ sn9c102_store_i2c_val(struct device* cd, struct device_attribute *attr, if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) return -ERESTARTSYS; - cam = video_get_drvdata(container_of(cd, struct video_device, - class_dev)); + cam = video_get_drvdata(container_of(cd, struct video_device, dev)); if (!cam) { mutex_unlock(&sn9c102_sysfs_lock); return -ENODEV; @@ -1318,8 +1310,7 @@ sn9c102_store_green(struct device* cd, struct device_attribute *attr, if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) return -ERESTARTSYS; - cam = video_get_drvdata(container_of(cd, struct video_device, - class_dev)); + cam = video_get_drvdata(container_of(cd, struct video_device, dev)); if (!cam) { mutex_unlock(&sn9c102_sysfs_lock); return -ENODEV; @@ -1400,8 +1391,7 @@ static ssize_t sn9c102_show_frame_header(struct device* cd, struct sn9c102_device* cam; ssize_t count; - cam = video_get_drvdata(container_of(cd, struct video_device, - class_dev)); + cam = video_get_drvdata(container_of(cd, struct video_device, dev)); if (!cam) return -ENODEV; @@ -1428,49 +1418,49 @@ static DEVICE_ATTR(frame_header, S_IRUGO, sn9c102_show_frame_header, NULL); static int sn9c102_create_sysfs(struct sn9c102_device* cam) { - struct device *classdev = &(cam->v4ldev->class_dev); + struct device *dev = &(cam->v4ldev->dev); int err = 0; - if ((err = device_create_file(classdev, &dev_attr_reg))) + if ((err = device_create_file(dev, &dev_attr_reg))) goto err_out; - if ((err = device_create_file(classdev, &dev_attr_val))) + if ((err = device_create_file(dev, &dev_attr_val))) goto err_reg; - if ((err = device_create_file(classdev, &dev_attr_frame_header))) + if ((err = device_create_file(dev, &dev_attr_frame_header))) goto err_val; if (cam->sensor.sysfs_ops) { - if ((err = device_create_file(classdev, &dev_attr_i2c_reg))) + if ((err = device_create_file(dev, &dev_attr_i2c_reg))) goto err_frame_header; - if ((err = device_create_file(classdev, &dev_attr_i2c_val))) + if ((err = device_create_file(dev, &dev_attr_i2c_val))) goto err_i2c_reg; } if (cam->bridge == BRIDGE_SN9C101 || cam->bridge == BRIDGE_SN9C102) { - if ((err = device_create_file(classdev, &dev_attr_green))) + if ((err = device_create_file(dev, &dev_attr_green))) goto err_i2c_val; } else { - if ((err = device_create_file(classdev, &dev_attr_blue))) + if ((err = device_create_file(dev, &dev_attr_blue))) goto err_i2c_val; - if ((err = device_create_file(classdev, &dev_attr_red))) + if ((err = device_create_file(dev, &dev_attr_red))) goto err_blue; } return 0; err_blue: - device_remove_file(classdev, &dev_attr_blue); + device_remove_file(dev, &dev_attr_blue); err_i2c_val: if (cam->sensor.sysfs_ops) - device_remove_file(classdev, &dev_attr_i2c_val); + device_remove_file(dev, &dev_attr_i2c_val); err_i2c_reg: if (cam->sensor.sysfs_ops) - device_remove_file(classdev, &dev_attr_i2c_reg); + device_remove_file(dev, &dev_attr_i2c_reg); err_frame_header: - device_remove_file(classdev, &dev_attr_frame_header); + device_remove_file(dev, &dev_attr_frame_header); err_val: - device_remove_file(classdev, &dev_attr_val); + device_remove_file(dev, &dev_attr_val); err_reg: - device_remove_file(classdev, &dev_attr_reg); + device_remove_file(dev, &dev_attr_reg); err_out: return err; } -- cgit v1.2.3 From 9c39d7eafa366b807067697f7fc5b14d8b865179 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 21 Jul 2008 07:51:45 -0300 Subject: V4L/DVB (8483): Remove obsolete owner field from video_device struct. According to an old comment this should have been removed in 2.6.15. Better late than never... Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/sn9c102/sn9c102_core.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/media/video/sn9c102/sn9c102_core.c') diff --git a/drivers/media/video/sn9c102/sn9c102_core.c b/drivers/media/video/sn9c102/sn9c102_core.c index 475b7819115..c68bf0921e9 100644 --- a/drivers/media/video/sn9c102/sn9c102_core.c +++ b/drivers/media/video/sn9c102/sn9c102_core.c @@ -3309,7 +3309,6 @@ sn9c102_usb_probe(struct usb_interface* intf, const struct usb_device_id* id) } strcpy(cam->v4ldev->name, "SN9C1xx PC Camera"); - cam->v4ldev->owner = THIS_MODULE; cam->v4ldev->type = VID_TYPE_CAPTURE | VID_TYPE_SCALES; cam->v4ldev->fops = &sn9c102_fops; cam->v4ldev->minor = video_nr[dev_nr]; -- cgit v1.2.3 From 0ea6bc8d43c9ee3c5384bea184eab020927a5b2c Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sat, 26 Jul 2008 08:26:43 -0300 Subject: V4L/DVB (8523): v4l2-dev: remove unused type and type2 field from video_device The type and type2 fields were unused and so could be removed. Instead add a vfl_type field that contains the type of the video device. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/sn9c102/sn9c102_core.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/media/video/sn9c102/sn9c102_core.c') diff --git a/drivers/media/video/sn9c102/sn9c102_core.c b/drivers/media/video/sn9c102/sn9c102_core.c index c68bf0921e9..23408764d0e 100644 --- a/drivers/media/video/sn9c102/sn9c102_core.c +++ b/drivers/media/video/sn9c102/sn9c102_core.c @@ -3309,7 +3309,6 @@ sn9c102_usb_probe(struct usb_interface* intf, const struct usb_device_id* id) } strcpy(cam->v4ldev->name, "SN9C1xx PC Camera"); - cam->v4ldev->type = VID_TYPE_CAPTURE | VID_TYPE_SCALES; cam->v4ldev->fops = &sn9c102_fops; cam->v4ldev->minor = video_nr[dev_nr]; cam->v4ldev->release = video_device_release; -- cgit v1.2.3