aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/stk-webcam.c
diff options
context:
space:
mode:
authorDavid Ellingsworth <david@identd.dyndns.org>2008-10-13 16:54:52 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-17 16:14:57 -0400
commit081d868faeb7acdd655c28607f84e797240bd035 (patch)
tree35e0bcd9c8dbb1875f8d20abc957fcb66fda13ea /drivers/media/video/stk-webcam.c
parent962d699e5d12952c43d7316bc72a527a8aa134b7 (diff)
V4L/DVB (9193): stk-webcam: minor cleanup
This patch: 1) removes the unnecessary kref.h include file 2) removes unnecessary pointer validation from read and poll routines. (Neither poll nor read may be called unless a call to open succeeds. A successful call to open will always set the file private_data pointer. Verifying that it is not null is therefore unnecessary. The associated release and mmap calls currently ignore this check.) 3) adds a space to syslog output. 4) removes an unused function prototype. Signed-off-by: David Ellingsworth <david@identd.dyndns.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/stk-webcam.c')
-rw-r--r--drivers/media/video/stk-webcam.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/media/video/stk-webcam.c b/drivers/media/video/stk-webcam.c
index db69bc5556d6..f1d5b3eaa192 100644
--- a/drivers/media/video/stk-webcam.c
+++ b/drivers/media/video/stk-webcam.c
@@ -27,7 +27,6 @@
27#include <linux/kernel.h> 27#include <linux/kernel.h>
28#include <linux/errno.h> 28#include <linux/errno.h>
29#include <linux/slab.h> 29#include <linux/slab.h>
30#include <linux/kref.h>
31 30
32#include <linux/usb.h> 31#include <linux/usb.h>
33#include <linux/mm.h> 32#include <linux/mm.h>
@@ -714,9 +713,6 @@ static ssize_t v4l_stk_read(struct file *fp, char __user *buf,
714 struct stk_sio_buffer *sbuf; 713 struct stk_sio_buffer *sbuf;
715 struct stk_camera *dev = fp->private_data; 714 struct stk_camera *dev = fp->private_data;
716 715
717 if (dev == NULL)
718 return -EIO;
719
720 if (!is_present(dev)) 716 if (!is_present(dev))
721 return -EIO; 717 return -EIO;
722 if (dev->owner && dev->owner != fp) 718 if (dev->owner && dev->owner != fp)
@@ -773,9 +769,6 @@ static unsigned int v4l_stk_poll(struct file *fp, poll_table *wait)
773{ 769{
774 struct stk_camera *dev = fp->private_data; 770 struct stk_camera *dev = fp->private_data;
775 771
776 if (dev == NULL)
777 return -ENODEV;
778
779 poll_wait(fp, &dev->wait_frame, wait); 772 poll_wait(fp, &dev->wait_frame, wait);
780 773
781 if (!is_present(dev)) 774 if (!is_present(dev))
@@ -1436,7 +1429,7 @@ static void stk_camera_disconnect(struct usb_interface *interface)
1436 wake_up_interruptible(&dev->wait_frame); 1429 wake_up_interruptible(&dev->wait_frame);
1437 stk_remove_sysfs_files(&dev->vdev); 1430 stk_remove_sysfs_files(&dev->vdev);
1438 1431
1439 STK_INFO("Syntek USB2.0 Camera release resources" 1432 STK_INFO("Syntek USB2.0 Camera release resources "
1440 "video device /dev/video%d\n", dev->vdev.minor); 1433 "video device /dev/video%d\n", dev->vdev.minor);
1441 1434
1442 video_unregister_device(&dev->vdev); 1435 video_unregister_device(&dev->vdev);