diff options
Diffstat (limited to 'drivers/media/video/pwc/pwc-if.c')
-rw-r--r-- | drivers/media/video/pwc/pwc-if.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c index 423fa7c2d0c9..9aee7cb6f79a 100644 --- a/drivers/media/video/pwc/pwc-if.c +++ b/drivers/media/video/pwc/pwc-if.c | |||
@@ -165,9 +165,7 @@ static const struct file_operations pwc_fops = { | |||
165 | .llseek = no_llseek, | 165 | .llseek = no_llseek, |
166 | }; | 166 | }; |
167 | static struct video_device pwc_template = { | 167 | static struct video_device pwc_template = { |
168 | .owner = THIS_MODULE, | ||
169 | .name = "Philips Webcam", /* Filled in later */ | 168 | .name = "Philips Webcam", /* Filled in later */ |
170 | .type = VID_TYPE_CAPTURE, | ||
171 | .release = video_device_release, | 169 | .release = video_device_release, |
172 | .fops = &pwc_fops, | 170 | .fops = &pwc_fops, |
173 | .minor = -1, | 171 | .minor = -1, |
@@ -1048,19 +1046,20 @@ static int pwc_create_sysfs_files(struct video_device *vdev) | |||
1048 | struct pwc_device *pdev = video_get_drvdata(vdev); | 1046 | struct pwc_device *pdev = video_get_drvdata(vdev); |
1049 | int rc; | 1047 | int rc; |
1050 | 1048 | ||
1051 | rc = video_device_create_file(vdev, &dev_attr_button); | 1049 | rc = device_create_file(&vdev->dev, &dev_attr_button); |
1052 | if (rc) | 1050 | if (rc) |
1053 | goto err; | 1051 | goto err; |
1054 | if (pdev->features & FEATURE_MOTOR_PANTILT) { | 1052 | if (pdev->features & FEATURE_MOTOR_PANTILT) { |
1055 | rc = video_device_create_file(vdev, &dev_attr_pan_tilt); | 1053 | rc = device_create_file(&vdev->dev, &dev_attr_pan_tilt); |
1056 | if (rc) goto err_button; | 1054 | if (rc) goto err_button; |
1057 | } | 1055 | } |
1058 | 1056 | ||
1059 | return 0; | 1057 | return 0; |
1060 | 1058 | ||
1061 | err_button: | 1059 | err_button: |
1062 | video_device_remove_file(vdev, &dev_attr_button); | 1060 | device_remove_file(&vdev->dev, &dev_attr_button); |
1063 | err: | 1061 | err: |
1062 | PWC_ERROR("Could not create sysfs files.\n"); | ||
1064 | return rc; | 1063 | return rc; |
1065 | } | 1064 | } |
1066 | 1065 | ||
@@ -1068,8 +1067,8 @@ static void pwc_remove_sysfs_files(struct video_device *vdev) | |||
1068 | { | 1067 | { |
1069 | struct pwc_device *pdev = video_get_drvdata(vdev); | 1068 | struct pwc_device *pdev = video_get_drvdata(vdev); |
1070 | if (pdev->features & FEATURE_MOTOR_PANTILT) | 1069 | if (pdev->features & FEATURE_MOTOR_PANTILT) |
1071 | video_device_remove_file(vdev, &dev_attr_pan_tilt); | 1070 | device_remove_file(&vdev->dev, &dev_attr_pan_tilt); |
1072 | video_device_remove_file(vdev, &dev_attr_button); | 1071 | device_remove_file(&vdev->dev, &dev_attr_button); |
1073 | } | 1072 | } |
1074 | 1073 | ||
1075 | #ifdef CONFIG_USB_PWC_DEBUG | 1074 | #ifdef CONFIG_USB_PWC_DEBUG |
@@ -1767,9 +1766,8 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id | |||
1767 | return -ENOMEM; | 1766 | return -ENOMEM; |
1768 | } | 1767 | } |
1769 | memcpy(pdev->vdev, &pwc_template, sizeof(pwc_template)); | 1768 | memcpy(pdev->vdev, &pwc_template, sizeof(pwc_template)); |
1770 | pdev->vdev->dev = &(udev->dev); | 1769 | pdev->vdev->parent = &(udev->dev); |
1771 | strcpy(pdev->vdev->name, name); | 1770 | strcpy(pdev->vdev->name, name); |
1772 | pdev->vdev->owner = THIS_MODULE; | ||
1773 | video_set_drvdata(pdev->vdev, pdev); | 1771 | video_set_drvdata(pdev->vdev, pdev); |
1774 | 1772 | ||
1775 | pdev->release = le16_to_cpu(udev->descriptor.bcdDevice); | 1773 | pdev->release = le16_to_cpu(udev->descriptor.bcdDevice); |