diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-04-08 04:35:30 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-08 04:35:30 -0400 |
commit | 5ea472a77f8e4811ceee3f44a9deda6ad6e8b789 (patch) | |
tree | a9ec5019e2b666a19874fc344ffb0dd5da6bce94 /drivers/media/video/v4l2-dev.c | |
parent | 6c009ecef8cca28c7c09eb16d0802e37915a76e1 (diff) | |
parent | 577c9c456f0e1371cbade38eaf91ae8e8a308555 (diff) |
Merge commit 'v2.6.30-rc1' into perfcounters/core
Conflicts:
arch/powerpc/include/asm/systbl.h
arch/powerpc/include/asm/unistd.h
include/linux/init_task.h
Merge reason: the conflicts are non-trivial: PowerPC placement
of sys_perf_counter_open has to be mixed with the
new preadv/pwrite syscalls.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/media/video/v4l2-dev.c')
-rw-r--r-- | drivers/media/video/v4l2-dev.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c index 91228b3df07d..31eac66411d7 100644 --- a/drivers/media/video/v4l2-dev.c +++ b/drivers/media/video/v4l2-dev.c | |||
@@ -229,7 +229,7 @@ static int v4l2_mmap(struct file *filp, struct vm_area_struct *vm) | |||
229 | static int v4l2_open(struct inode *inode, struct file *filp) | 229 | static int v4l2_open(struct inode *inode, struct file *filp) |
230 | { | 230 | { |
231 | struct video_device *vdev; | 231 | struct video_device *vdev; |
232 | int ret; | 232 | int ret = 0; |
233 | 233 | ||
234 | /* Check if the video device is available */ | 234 | /* Check if the video device is available */ |
235 | mutex_lock(&videodev_lock); | 235 | mutex_lock(&videodev_lock); |
@@ -243,7 +243,9 @@ static int v4l2_open(struct inode *inode, struct file *filp) | |||
243 | /* and increase the device refcount */ | 243 | /* and increase the device refcount */ |
244 | video_get(vdev); | 244 | video_get(vdev); |
245 | mutex_unlock(&videodev_lock); | 245 | mutex_unlock(&videodev_lock); |
246 | ret = vdev->fops->open(filp); | 246 | if (vdev->fops->open) |
247 | ret = vdev->fops->open(filp); | ||
248 | |||
247 | /* decrease the refcount in case of an error */ | 249 | /* decrease the refcount in case of an error */ |
248 | if (ret) | 250 | if (ret) |
249 | video_put(vdev); | 251 | video_put(vdev); |
@@ -254,7 +256,10 @@ static int v4l2_open(struct inode *inode, struct file *filp) | |||
254 | static int v4l2_release(struct inode *inode, struct file *filp) | 256 | static int v4l2_release(struct inode *inode, struct file *filp) |
255 | { | 257 | { |
256 | struct video_device *vdev = video_devdata(filp); | 258 | struct video_device *vdev = video_devdata(filp); |
257 | int ret = vdev->fops->release(filp); | 259 | int ret = 0; |
260 | |||
261 | if (vdev->fops->release) | ||
262 | vdev->fops->release(filp); | ||
258 | 263 | ||
259 | /* decrease the refcount unconditionally since the release() | 264 | /* decrease the refcount unconditionally since the release() |
260 | return value is ignored. */ | 265 | return value is ignored. */ |