summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/usbvision
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/usbvision')
-rw-r--r--linux/drivers/media/video/usbvision/usbvision-core.c90
-rw-r--r--linux/drivers/media/video/usbvision/usbvision-i2c.c3
-rw-r--r--linux/drivers/media/video/usbvision/usbvision-video.c177
-rw-r--r--linux/drivers/media/video/usbvision/usbvision.h4
4 files changed, 3 insertions, 271 deletions
diff --git a/linux/drivers/media/video/usbvision/usbvision-core.c b/linux/drivers/media/video/usbvision/usbvision-core.c
index ce9348a07..c5bc897e9 100644
--- a/linux/drivers/media/video/usbvision/usbvision-core.c
+++ b/linux/drivers/media/video/usbvision/usbvision-core.c
@@ -45,13 +45,7 @@
#include <media/tuner.h>
#include <media/audiochip.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-#include <linux/proc_fs.h>
-#include <linux/tqueue.h>
-#include <linux/wrapper.h>
-#else
#include <linux/workqueue.h>
-#endif
#ifdef CONFIG_KMOD
#include <linux/kmod.h>
@@ -174,40 +168,6 @@ static void usbvision_rvfree(void *mem, unsigned long size)
vfree(mem);
}
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,24)
-/* helper functions to access driver private data. */
-static inline void *video_get_drvdata(struct video_device *dev)
-{
- return dev->priv;
-}
-
-static inline void video_set_drvdata(struct video_device *dev, void *data)
-{
- dev->priv = data;
-}
-
-struct video_device *video_device_alloc(void)
-{
- struct video_device *vfd;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)
- vfd = kmalloc(sizeof(*vfd),GFP_KERNEL);
- if (NULL == vfd)
- return NULL;
- memset(vfd,0,sizeof(*vfd));
-#else
- vfd = kzalloc(sizeof(*vfd),GFP_KERNEL);
- if (NULL == vfd)
- return NULL;
-#endif
- return vfd;
-}
-
-void video_device_release(struct video_device *vfd)
-{
- kfree(vfd);
-}
-#endif
-
#if ENABLE_HEXDUMP
static void usbvision_hexdump(const unsigned char *data, int len)
@@ -1485,7 +1445,7 @@ static int usbvision_compress_isochronous(struct usb_usbvision *usbvision,
return totlen;
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) || LINUX_VERSION_CODE > KERNEL_VERSION(2,6,18)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,18)
static void usbvision_isocIrq(struct urb *urb)
{
#else
@@ -1559,7 +1519,6 @@ static void usbvision_isocIrq(struct urb *urb, struct pt_regs *regs)
urb->iso_frame_desc[i].actual_length = 0;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
urb->status = 0;
urb->dev = usbvision->dev;
errCode = usb_submit_urb (urb, GFP_ATOMIC);
@@ -1568,7 +1527,6 @@ static void usbvision_isocIrq(struct urb *urb, struct pt_regs *regs)
err("%s: usb_submit_urb failed: error %d",
__func__, errCode);
}
-#endif
return;
}
@@ -1632,7 +1590,7 @@ int usbvision_write_reg(struct usb_usbvision *usbvision, unsigned char reg,
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) || LINUX_VERSION_CODE > KERNEL_VERSION(2,6,18)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,18)
static void usbvision_ctrlUrb_complete(struct urb *urb)
#else
static void usbvision_ctrlUrb_complete(struct urb *urb, struct pt_regs *regs)
@@ -1662,19 +1620,11 @@ static int usbvision_write_reg_irq(struct usb_usbvision *usbvision,int address,
}
usbvision->ctrlUrbBusy = 1;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,20)
- usbvision->ctrlUrbSetup.requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT;
- usbvision->ctrlUrbSetup.request = USBVISION_OP_CODE;
- usbvision->ctrlUrbSetup.value = 0;
- usbvision->ctrlUrbSetup.index = cpu_to_le16(address);
- usbvision->ctrlUrbSetup.length = cpu_to_le16(len);
-#else
usbvision->ctrlUrbSetup.bRequestType = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT;
usbvision->ctrlUrbSetup.bRequest = USBVISION_OP_CODE;
usbvision->ctrlUrbSetup.wValue = 0;
usbvision->ctrlUrbSetup.wIndex = cpu_to_le16(address);
usbvision->ctrlUrbSetup.wLength = cpu_to_le16(len);
-#endif
usb_fill_control_urb (usbvision->ctrlUrb, usbvision->dev,
usb_sndctrlpipe(usbvision->dev, 1),
(unsigned char *)&usbvision->ctrlUrbSetup,
@@ -1684,11 +1634,7 @@ static int usbvision_write_reg_irq(struct usb_usbvision *usbvision,int address,
memcpy(usbvision->ctrlUrbBuffer, data, len);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- errCode = usb_submit_urb(usbvision->ctrlUrb);
-#else
errCode = usb_submit_urb(usbvision->ctrlUrb, GFP_ATOMIC);
-#endif
if (errCode < 0) {
// error in usb_submit_urb()
usbvision->ctrlUrbBusy = 0;
@@ -2385,18 +2331,12 @@ static void usbvision_powerOffTimer(unsigned long data)
PDEBUG(DBG_FUNC, "");
del_timer(&usbvision->powerOffTimer);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- INIT_TQUEUE(&usbvision->powerOffTask, call_usbvision_power_off, usbvision);
- (void) schedule_task(&usbvision->powerOffTask);
-#else
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
INIT_WORK(&usbvision->powerOffWork, call_usbvision_power_off, usbvision);
#else
INIT_WORK(&usbvision->powerOffWork, call_usbvision_power_off);
#endif
(void) schedule_work(&usbvision->powerOffWork);
-#endif
-
}
void usbvision_init_powerOffTimer(struct usb_usbvision *usbvision)
@@ -2568,11 +2508,7 @@ int usbvision_init_isoc(struct usb_usbvision *usbvision)
int j, k;
struct urb *urb;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- urb = usb_alloc_urb(USBVISION_URB_FRAMES);
-#else
urb = usb_alloc_urb(USBVISION_URB_FRAMES, GFP_KERNEL);
-#endif
if (urb == NULL) {
err("%s: usb_alloc_urb() failed", __func__);
return -ENOMEM;
@@ -2586,12 +2522,8 @@ int usbvision_init_isoc(struct usb_usbvision *usbvision)
urb->dev = dev;
urb->context = usbvision;
urb->pipe = usb_rcvisocpipe(dev, usbvision->video_endp);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- urb->transfer_flags = USB_ISO_ASAP;
-#else
urb->transfer_flags = URB_ISO_ASAP;
urb->interval = 1;
-#endif
urb->transfer_buffer = usbvision->sbuf[bufIdx].data;
urb->complete = usbvision_isocIrq;
urb->number_of_packets = USBVISION_URB_FRAMES;
@@ -2605,28 +2537,10 @@ int usbvision_init_isoc(struct usb_usbvision *usbvision)
}
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- /* Link URBs into a ring so that they invoke each other infinitely */
- for (bufIdx = 0; bufIdx < USBVISION_NUMSBUF; bufIdx++) {
- if ((bufIdx + 1) < USBVISION_NUMSBUF) {
- usbvision->sbuf[bufIdx].urb->next =
- usbvision->sbuf[bufIdx + 1].urb;
- }
- else {
- usbvision->sbuf[bufIdx].urb->next =
- usbvision->sbuf[0].urb;
- }
- }
-#endif
-
/* Submit all URBs */
for (bufIdx = 0; bufIdx < USBVISION_NUMSBUF; bufIdx++) {
- #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- errCode = usb_submit_urb(usbvision->sbuf[bufIdx].urb);
- #else
errCode = usb_submit_urb(usbvision->sbuf[bufIdx].urb,
GFP_KERNEL);
- #endif
if (errCode) {
err("%s: usb_submit_urb(%d) failed: error %d",
__func__, bufIdx, errCode);
diff --git a/linux/drivers/media/video/usbvision/usbvision-i2c.c b/linux/drivers/media/video/usbvision/usbvision-i2c.c
index 67efd7821..d6d12debc 100644
--- a/linux/drivers/media/video/usbvision/usbvision-i2c.c
+++ b/linux/drivers/media/video/usbvision/usbvision-i2c.c
@@ -208,9 +208,6 @@ static void dec_use(struct i2c_adapter *adap)
/* -----exported algorithm data: ------------------------------------- */
static struct i2c_algorithm usbvision_algo = {
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)) && (LINUX_VERSION_CODE > KERNEL_VERSION(2,4,30))
- .owner = THIS_MODULE,
-#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
.name = "USB algorithm",
.id = I2C_ALGO_BIT, /* FIXME */
diff --git a/linux/drivers/media/video/usbvision/usbvision-video.c b/linux/drivers/media/video/usbvision/usbvision-video.c
index 55b3f5e60..bd3d49abf 100644
--- a/linux/drivers/media/video/usbvision/usbvision-video.c
+++ b/linux/drivers/media/video/usbvision/usbvision-video.c
@@ -68,13 +68,7 @@
#include <media/tuner.h>
#include <media/audiochip.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-#include <linux/proc_fs.h>
-#include <linux/tqueue.h>
-#include <linux/wrapper.h>
-#else
#include <linux/workqueue.h>
-#endif
#ifdef CONFIG_KMOD
#include <linux/kmod.h>
@@ -173,10 +167,8 @@ MODULE_PARM_DESC(vbi_nr, "Set vbi device number (/dev/vbiX). Default: -1 (autod
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE(DRIVER_LICENSE);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
MODULE_VERSION(USBVISION_VERSION_STRING);
MODULE_ALIAS(DRIVER_ALIAS);
-#endif
/*****************************************************************************/
@@ -187,8 +179,6 @@ MODULE_ALIAS(DRIVER_ALIAS);
/* /sys/bus/usb/drivers/USBVision Video Grabber */
/*****************************************************************************/
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
-
#define YES_NO(x) ((x) ? "Yes" : "No")
static inline struct usb_usbvision *cd_to_usbvision(struct device *cd)
@@ -379,8 +369,6 @@ static void usbvision_remove_sysfs(struct video_device *vdev)
}
}
-#endif
-
/*
* usbvision_open()
*
@@ -389,25 +377,15 @@ static void usbvision_remove_sysfs(struct video_device *vdev)
* then allocates buffers needed for video processing.
*
*/
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,19)
-static int usbvision_v4l2_open(struct video_device *dev, int flags)
-{
- struct usb_usbvision *usbvision = (struct usb_usbvision *) dev;
-#else
static int usbvision_v4l2_open(struct inode *inode, struct file *file)
{
struct video_device *dev = video_devdata(file);
struct usb_usbvision *usbvision =
(struct usb_usbvision *) video_get_drvdata(dev);
-#endif
int errCode = 0;
PDEBUG(DBG_IO, "open");
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- MOD_INC_USE_COUNT;
-#endif
-
usbvision_reset_powerOffTimer(usbvision);
if (usbvision->user)
@@ -461,12 +439,6 @@ static int usbvision_v4l2_open(struct inode *inode, struct file *file)
mutex_unlock(&usbvision->lock);
}
- if (errCode) {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- MOD_DEC_USE_COUNT;
-#endif
- }
-
/* prepare queues */
usbvision_empty_framequeues(usbvision);
@@ -482,17 +454,11 @@ static int usbvision_v4l2_open(struct inode *inode, struct file *file)
* allocated in usbvision_v4l2_open().
*
*/
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,19)
-static void usbvision_v4l2_close(struct video_device *dev)
-{
- struct usb_usbvision *usbvision = (struct usb_usbvision *) dev;
-#else
static int usbvision_v4l2_close(struct inode *inode, struct file *file)
{
struct video_device *dev = video_devdata(file);
struct usb_usbvision *usbvision =
(struct usb_usbvision *) video_get_drvdata(dev);
-#endif
PDEBUG(DBG_IO, "close");
mutex_lock(&usbvision->lock);
@@ -523,14 +489,7 @@ static int usbvision_v4l2_close(struct inode *inode, struct file *file)
}
PDEBUG(DBG_IO, "success");
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- MOD_DEC_USE_COUNT;
-#endif
-
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,19)
return 0;
-#endif
}
@@ -1123,12 +1082,6 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
return 0;
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,19)
-static long usbvision_v4l2_read(struct video_device *dev, char *buf,
- unsigned long count, int noblock)
-{
- struct usb_usbvision *usbvision = (struct usb_usbvision *) dev;
-#else
static ssize_t usbvision_v4l2_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
@@ -1136,7 +1089,6 @@ static ssize_t usbvision_v4l2_read(struct file *file, char __user *buf,
struct usb_usbvision *usbvision =
(struct usb_usbvision *) video_get_drvdata(dev);
int noblock = file->f_flags & O_NONBLOCK;
-#endif
unsigned long lock_flags;
int ret,i;
@@ -1302,24 +1254,15 @@ static int usbvision_v4l2_mmap(struct file *file, struct vm_area_struct *vma)
* Here comes the stuff for radio on usbvision based devices
*
*/
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,19)
-static int usbvision_radio_open(struct video_device *dev, int flags)
-{
- struct usb_usbvision *usbvision = (struct usb_usbvision *)dev->priv;
-#else
static int usbvision_radio_open(struct inode *inode, struct file *file)
{
struct video_device *dev = video_devdata(file);
struct usb_usbvision *usbvision =
(struct usb_usbvision *) video_get_drvdata(dev);
-#endif
int errCode = 0;
PDEBUG(DBG_IO, "%s:", __func__);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- MOD_INC_USE_COUNT;
-#endif
mutex_lock(&usbvision->lock);
if (usbvision->user) {
@@ -1351,9 +1294,6 @@ static int usbvision_radio_open(struct inode *inode, struct file *file)
}
if (errCode) {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- MOD_DEC_USE_COUNT;
-#endif
if (PowerOnAtOpen) {
usbvision_i2c_unregister(usbvision);
usbvision_power_off(usbvision);
@@ -1366,18 +1306,12 @@ out:
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,19)
-static void usbvision_radio_close(struct video_device *dev)
-{
- struct usb_usbvision *usbvision = (struct usb_usbvision *)dev->priv;
-#else
static int usbvision_radio_close(struct inode *inode, struct file *file)
{
struct video_device *dev = video_devdata(file);
struct usb_usbvision *usbvision =
(struct usb_usbvision *) video_get_drvdata(dev);
int errCode = 0;
-#endif
PDEBUG(DBG_IO, "");
@@ -1404,42 +1338,22 @@ static int usbvision_radio_close(struct inode *inode, struct file *file)
usbvision_release(usbvision);
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- MOD_DEC_USE_COUNT;
-#endif
-
PDEBUG(DBG_IO, "success");
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,19)
return errCode;
-#endif
}
/*
* Here comes the stuff for vbi on usbvision based devices
*
*/
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,19)
-static int usbvision_vbi_open(struct video_device *dev, int flags)
-{
- struct usb_usbvision *usbvision = (struct usb_usbvision *)dev->priv;
-#else
static int usbvision_vbi_open(struct inode *inode, struct file *file)
{
-#endif
/* TODO */
return -ENODEV;
-
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,19)
-static void usbvision_vbi_close(struct video_device *dev)
-{
- struct usb_usbvision *usbvision = (struct usb_usbvision *)dev->priv;
-#else
static int usbvision_vbi_close(struct inode *inode, struct file *file)
{
-#endif
/* TODO */
return -ENODEV;
}
@@ -1463,21 +1377,8 @@ static int usbvision_vbi_ioctl(struct inode *inode, struct file *file,
//
// Video template
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,19)
-static struct video_device usbvision_video_template = {
- .type = VID_TYPE_TUNER | VID_TYPE_CAPTURE,
- .open = usbvision_v4l2_open,
- .close = usbvision_v4l2_close,
- .read = usbvision_v4l2_read,
- .mmap = usbvision_v4l2_mmap,
- .ioctl = video_ioctl2,
- .minor = -1,
-};
-#else
static const struct file_operations usbvision_fops = {
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,31)
.owner = THIS_MODULE,
-#endif
.open = usbvision_v4l2_open,
.release = usbvision_v4l2_close,
.read = usbvision_v4l2_read,
@@ -1490,15 +1391,11 @@ static const struct file_operations usbvision_fops = {
#endif
};
static struct video_device usbvision_video_template = {
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,31)
.owner = THIS_MODULE,
-#endif
.type = VID_TYPE_TUNER | VID_TYPE_CAPTURE,
.fops = &usbvision_fops,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
.name = "usbvision-video",
.release = video_device_release,
-#endif
.minor = -1,
.vidioc_querycap = vidioc_querycap,
.vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap,
@@ -1534,24 +1431,11 @@ static struct video_device usbvision_video_template = {
.tvnorms = USBVISION_NORMS,
.current_norm = V4L2_STD_PAL
};
-#endif
// Radio template
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,19)
-static struct video_device usbvision_radio_template=
-{
- .type = VID_TYPE_TUNER,
- .open = usbvision_radio_open,
- .close = usbvision_radio_close,
- .ioctl = video_ioctl2,
- .minor -1,
-};
-#else
static const struct file_operations usbvision_radio_fops = {
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,31)
.owner = THIS_MODULE,
-#endif
.open = usbvision_radio_open,
.release = usbvision_radio_close,
.ioctl = video_ioctl2,
@@ -1563,15 +1447,11 @@ static const struct file_operations usbvision_radio_fops = {
static struct video_device usbvision_radio_template=
{
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,31)
.owner = THIS_MODULE,
-#endif
.type = VID_TYPE_TUNER,
.fops = &usbvision_radio_fops,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
.name = "usbvision-radio",
.release = video_device_release,
-#endif
.minor = -1,
.vidioc_querycap = vidioc_querycap,
.vidioc_enum_input = vidioc_enum_input,
@@ -1590,23 +1470,10 @@ static struct video_device usbvision_radio_template=
.tvnorms = USBVISION_NORMS,
.current_norm = V4L2_STD_PAL
};
-#endif
// vbi template
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,19)
-static struct video_device usbvision_vbi_template=
-{
- type: VID_TYPE_TELETEXT,
- open: usbvision_vbi_open,
- close: usbvision_vbi_close,
- ioctl: usbvision_vbi_ioctl,
- minor: -1,
-};
-#else
static const struct file_operations usbvision_vbi_fops = {
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,31)
.owner = THIS_MODULE,
-#endif
.open = usbvision_vbi_open,
.release = usbvision_vbi_close,
.ioctl = usbvision_vbi_ioctl,
@@ -1618,18 +1485,13 @@ static const struct file_operations usbvision_vbi_fops = {
static struct video_device usbvision_vbi_template=
{
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,31)
.owner = THIS_MODULE,
-#endif
.type = VID_TYPE_TUNER,
.fops = &usbvision_vbi_fops,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
.release = video_device_release,
.name = "usbvision-vbi",
-#endif
.minor = -1,
};
-#endif
static struct video_device *usbvision_vdev_init(struct usb_usbvision *usbvision,
@@ -1650,9 +1512,7 @@ static struct video_device *usbvision_vdev_init(struct usb_usbvision *usbvision,
}
*vdev = *vdev_template;
// vdev->minor = -1;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
vdev->dev = &usb_dev->dev;
-#endif
snprintf(vdev->name, sizeof(vdev->name), "%s", name);
video_set_drvdata(vdev, usbvision);
return vdev;
@@ -1667,9 +1527,6 @@ static void usbvision_unregister_video(struct usb_usbvision *usbvision)
usbvision->vbi->minor & 0x1f);
if (usbvision->vbi->minor != -1) {
video_unregister_device(usbvision->vbi);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- video_device_release(usbvision->vbi);
-#endif
} else {
video_device_release(usbvision->vbi);
}
@@ -1682,9 +1539,6 @@ static void usbvision_unregister_video(struct usb_usbvision *usbvision)
usbvision->rdev->minor & 0x1f);
if (usbvision->rdev->minor != -1) {
video_unregister_device(usbvision->rdev);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- video_device_release(usbvision->rdev);
-#endif
} else {
video_device_release(usbvision->rdev);
}
@@ -1697,9 +1551,6 @@ static void usbvision_unregister_video(struct usb_usbvision *usbvision)
usbvision->vdev->minor & 0x1f);
if (usbvision->vdev->minor != -1) {
video_unregister_device(usbvision->vdev);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- video_device_release(usbvision->vdev);
-#endif
} else {
video_device_release(usbvision->vdev);
}
@@ -1799,11 +1650,7 @@ static struct usb_usbvision *usbvision_alloc(struct usb_device *dev)
mutex_init(&usbvision->lock); /* available */
// prepare control urb for control messages during interrupts
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- usbvision->ctrlUrb = usb_alloc_urb(USBVISION_URB_FRAMES);
-#else
usbvision->ctrlUrb = usb_alloc_urb(USBVISION_URB_FRAMES, GFP_KERNEL);
-#endif
if (usbvision->ctrlUrb == NULL) {
goto err_exit;
}
@@ -2006,12 +1853,7 @@ static int __devinit usbvision_probe(struct usb_interface *intf,
usbvision_create_sysfs(usbvision->vdev);
PDEBUG(DBG_PROBE, "success");
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- MOD_DEC_USE_COUNT;
- return usbvision;
-#else
return 0;
-#endif
}
@@ -2023,15 +1865,9 @@ static int __devinit usbvision_probe(struct usb_interface *intf,
* with no ill consequences.
*
*/
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-static void usbvision_disconnect(struct usb_device *dev, void *ptr)
-{
- struct usb_usbvision *usbvision = (struct usb_usbvision *) ptr;
-#else
static void __devexit usbvision_disconnect(struct usb_interface *intf)
{
struct usb_usbvision *usbvision = usb_get_intfdata(intf);
-#endif
PDEBUG(DBG_PROBE, "");
@@ -2039,11 +1875,7 @@ static void __devexit usbvision_disconnect(struct usb_interface *intf)
err("%s: usb_get_intfdata() failed", __func__);
return;
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- MOD_INC_USE_COUNT;
-#else
usb_set_intfdata (intf, NULL);
-#endif
mutex_lock(&usbvision->lock);
@@ -2056,9 +1888,7 @@ static void __devexit usbvision_disconnect(struct usb_interface *intf)
}
usbvision->remove_pending = 1; // Now all ISO data will be ignored
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
usb_put_dev(usbvision->dev);
-#endif
usbvision->dev = NULL; // USB device is no more
mutex_unlock(&usbvision->lock);
@@ -2073,15 +1903,10 @@ static void __devexit usbvision_disconnect(struct usb_interface *intf)
}
PDEBUG(DBG_PROBE, "success");
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- MOD_DEC_USE_COUNT;
-#endif
}
static struct usb_driver usbvision_driver = {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,31)) && \
- (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16))
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)
.owner = THIS_MODULE,
#endif
.name = "usbvision",
diff --git a/linux/drivers/media/video/usbvision/usbvision.h b/linux/drivers/media/video/usbvision/usbvision.h
index 9f4c40dbf..371c6987f 100644
--- a/linux/drivers/media/video/usbvision/usbvision.h
+++ b/linux/drivers/media/video/usbvision/usbvision.h
@@ -401,11 +401,7 @@ struct usb_usbvision {
struct semaphore lock;
#endif
struct timer_list powerOffTimer;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- struct tq_struct powerOffTask;
-#else
struct work_struct powerOffWork;
-#endif
int power; /* is the device powered on? */
int user; /* user count for exclusive use */
int initialized; /* Had we already sent init sequence? */