Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

David Ellingsworth and committed by
Mauro Carvalho Chehab
081d868f 962d699e

+1 -9
+1 -8
drivers/media/video/stk-webcam.c
··· 27 27 #include <linux/kernel.h> 28 28 #include <linux/errno.h> 29 29 #include <linux/slab.h> 30 - #include <linux/kref.h> 31 30 32 31 #include <linux/usb.h> 33 32 #include <linux/mm.h> ··· 713 714 struct stk_sio_buffer *sbuf; 714 715 struct stk_camera *dev = fp->private_data; 715 716 716 - if (dev == NULL) 717 - return -EIO; 718 - 719 717 if (!is_present(dev)) 720 718 return -EIO; 721 719 if (dev->owner && dev->owner != fp) ··· 768 772 static unsigned int v4l_stk_poll(struct file *fp, poll_table *wait) 769 773 { 770 774 struct stk_camera *dev = fp->private_data; 771 - 772 - if (dev == NULL) 773 - return -ENODEV; 774 775 775 776 poll_wait(fp, &dev->wait_frame, wait); 776 777 ··· 1429 1436 wake_up_interruptible(&dev->wait_frame); 1430 1437 stk_remove_sysfs_files(&dev->vdev); 1431 1438 1432 - STK_INFO("Syntek USB2.0 Camera release resources" 1439 + STK_INFO("Syntek USB2.0 Camera release resources " 1433 1440 "video device /dev/video%d\n", dev->vdev.minor); 1434 1441 1435 1442 video_unregister_device(&dev->vdev);
-1
drivers/media/video/stk-webcam.h
··· 122 122 123 123 #define vdev_to_camera(d) container_of(d, struct stk_camera, vdev) 124 124 125 - void stk_camera_delete(struct kref *); 126 125 int stk_camera_write_reg(struct stk_camera *, u16, u8); 127 126 int stk_camera_read_reg(struct stk_camera *, u16, int *); 128 127