diff options
Diffstat (limited to 'drivers/media/video/cpia.c')
-rw-r--r-- | drivers/media/video/cpia.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c index a661800b0e69..c325e926de8a 100644 --- a/drivers/media/video/cpia.c +++ b/drivers/media/video/cpia.c | |||
@@ -3155,7 +3155,7 @@ static void put_cam(struct cpia_camera_ops* ops) | |||
3155 | static int cpia_open(struct inode *inode, struct file *file) | 3155 | static int cpia_open(struct inode *inode, struct file *file) |
3156 | { | 3156 | { |
3157 | struct video_device *dev = video_devdata(file); | 3157 | struct video_device *dev = video_devdata(file); |
3158 | struct cam_data *cam = dev->priv; | 3158 | struct cam_data *cam = video_get_drvdata(dev); |
3159 | int err; | 3159 | int err; |
3160 | 3160 | ||
3161 | if (!cam) { | 3161 | if (!cam) { |
@@ -3202,7 +3202,7 @@ static int cpia_open(struct inode *inode, struct file *file) | |||
3202 | 3202 | ||
3203 | /* Set ownership of /proc/cpia/videoX to current user */ | 3203 | /* Set ownership of /proc/cpia/videoX to current user */ |
3204 | if(cam->proc_entry) | 3204 | if(cam->proc_entry) |
3205 | cam->proc_entry->uid = current->uid; | 3205 | cam->proc_entry->uid = current_uid(); |
3206 | 3206 | ||
3207 | /* set mark for loading first frame uncompressed */ | 3207 | /* set mark for loading first frame uncompressed */ |
3208 | cam->first_frame = 1; | 3208 | cam->first_frame = 1; |
@@ -3232,7 +3232,7 @@ static int cpia_open(struct inode *inode, struct file *file) | |||
3232 | static int cpia_close(struct inode *inode, struct file *file) | 3232 | static int cpia_close(struct inode *inode, struct file *file) |
3233 | { | 3233 | { |
3234 | struct video_device *dev = file->private_data; | 3234 | struct video_device *dev = file->private_data; |
3235 | struct cam_data *cam = dev->priv; | 3235 | struct cam_data *cam = video_get_drvdata(dev); |
3236 | 3236 | ||
3237 | if (cam->ops) { | 3237 | if (cam->ops) { |
3238 | /* Return ownership of /proc/cpia/videoX to root */ | 3238 | /* Return ownership of /proc/cpia/videoX to root */ |
@@ -3284,7 +3284,7 @@ static ssize_t cpia_read(struct file *file, char __user *buf, | |||
3284 | size_t count, loff_t *ppos) | 3284 | size_t count, loff_t *ppos) |
3285 | { | 3285 | { |
3286 | struct video_device *dev = file->private_data; | 3286 | struct video_device *dev = file->private_data; |
3287 | struct cam_data *cam = dev->priv; | 3287 | struct cam_data *cam = video_get_drvdata(dev); |
3288 | int err; | 3288 | int err; |
3289 | 3289 | ||
3290 | /* make this _really_ smp and multithread-safe */ | 3290 | /* make this _really_ smp and multithread-safe */ |
@@ -3341,7 +3341,7 @@ static int cpia_do_ioctl(struct inode *inode, struct file *file, | |||
3341 | unsigned int ioctlnr, void *arg) | 3341 | unsigned int ioctlnr, void *arg) |
3342 | { | 3342 | { |
3343 | struct video_device *dev = file->private_data; | 3343 | struct video_device *dev = file->private_data; |
3344 | struct cam_data *cam = dev->priv; | 3344 | struct cam_data *cam = video_get_drvdata(dev); |
3345 | int retval = 0; | 3345 | int retval = 0; |
3346 | 3346 | ||
3347 | if (!cam || !cam->ops) | 3347 | if (!cam || !cam->ops) |
@@ -3739,7 +3739,7 @@ static int cpia_mmap(struct file *file, struct vm_area_struct *vma) | |||
3739 | unsigned long start = vma->vm_start; | 3739 | unsigned long start = vma->vm_start; |
3740 | unsigned long size = vma->vm_end - vma->vm_start; | 3740 | unsigned long size = vma->vm_end - vma->vm_start; |
3741 | unsigned long page, pos; | 3741 | unsigned long page, pos; |
3742 | struct cam_data *cam = dev->priv; | 3742 | struct cam_data *cam = video_get_drvdata(dev); |
3743 | int retval; | 3743 | int retval; |
3744 | 3744 | ||
3745 | if (!cam || !cam->ops) | 3745 | if (!cam || !cam->ops) |
@@ -3801,6 +3801,7 @@ static const struct file_operations cpia_fops = { | |||
3801 | static struct video_device cpia_template = { | 3801 | static struct video_device cpia_template = { |
3802 | .name = "CPiA Camera", | 3802 | .name = "CPiA Camera", |
3803 | .fops = &cpia_fops, | 3803 | .fops = &cpia_fops, |
3804 | .release = video_device_release_empty, | ||
3804 | }; | 3805 | }; |
3805 | 3806 | ||
3806 | /* initialise cam_data structure */ | 3807 | /* initialise cam_data structure */ |
@@ -3928,7 +3929,7 @@ static void init_camera_struct(struct cam_data *cam, | |||
3928 | cam->proc_entry = NULL; | 3929 | cam->proc_entry = NULL; |
3929 | 3930 | ||
3930 | memcpy(&cam->vdev, &cpia_template, sizeof(cpia_template)); | 3931 | memcpy(&cam->vdev, &cpia_template, sizeof(cpia_template)); |
3931 | cam->vdev.priv = cam; | 3932 | video_set_drvdata(&cam->vdev, cam); |
3932 | 3933 | ||
3933 | cam->curframe = 0; | 3934 | cam->curframe = 0; |
3934 | for (i = 0; i < FRAME_NUM; i++) { | 3935 | for (i = 0; i < FRAME_NUM; i++) { |