Commit 30516058 authored by Tomas Winkler's avatar Tomas Winkler Committed by Greg Kroah-Hartman

staging/easycap: kill EASYCAP_NEEDS_V4L2_DEVICE_H and EASYCAP_NEEDS_V4L2_FOPS

EASYCAP_NEEDS_V4L2_DEVICE_H and EASYCAP_NEEDS_V4L2_FOPS are required in
in-tree driver

Cc: Mike Thomas <rmthomas@sciolus.org>
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 3e17e39e
...@@ -10,6 +10,4 @@ obj-$(CONFIG_EASYCAP) += easycap.o ...@@ -10,6 +10,4 @@ obj-$(CONFIG_EASYCAP) += easycap.o
ccflags-y := -Wall ccflags-y := -Wall
ccflags-y += -DEASYCAP_IS_VIDEODEV_CLIENT ccflags-y += -DEASYCAP_IS_VIDEODEV_CLIENT
ccflags-y += -DEASYCAP_NEEDS_V4L2_DEVICE_H
ccflags-y += -DEASYCAP_NEEDS_V4L2_FOPS
...@@ -31,8 +31,6 @@ ...@@ -31,8 +31,6 @@
* EASYCAP_DEBUG * EASYCAP_DEBUG
* EASYCAP_IS_VIDEODEV_CLIENT * EASYCAP_IS_VIDEODEV_CLIENT
* EASYCAP_NEEDS_USBVIDEO_H * EASYCAP_NEEDS_USBVIDEO_H
* EASYCAP_NEEDS_V4L2_DEVICE_H
* EASYCAP_NEEDS_V4L2_FOPS
* *
* IF REQUIRED THEY MUST BE EXTERNALLY DEFINED, FOR EXAMPLE AS COMPILER * IF REQUIRED THEY MUST BE EXTERNALLY DEFINED, FOR EXAMPLE AS COMPILER
* OPTIONS. * OPTIONS.
...@@ -87,9 +85,7 @@ ...@@ -87,9 +85,7 @@
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ /*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#ifdef EASYCAP_IS_VIDEODEV_CLIENT #ifdef EASYCAP_IS_VIDEODEV_CLIENT
#include <media/v4l2-dev.h> #include <media/v4l2-dev.h>
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/ #endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
#include <linux/videodev2.h> #include <linux/videodev2.h>
...@@ -306,9 +302,7 @@ struct easycap { ...@@ -306,9 +302,7 @@ struct easycap {
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ /*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#ifdef EASYCAP_IS_VIDEODEV_CLIENT #ifdef EASYCAP_IS_VIDEODEV_CLIENT
struct video_device video_device; struct video_device video_device;
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
struct v4l2_device v4l2_device; struct v4l2_device v4l2_device;
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/ #endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
int status; int status;
......
...@@ -3132,7 +3132,6 @@ static const struct usb_class_driver easycap_class = { ...@@ -3132,7 +3132,6 @@ static const struct usb_class_driver easycap_class = {
}; };
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ /*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#ifdef EASYCAP_IS_VIDEODEV_CLIENT #ifdef EASYCAP_IS_VIDEODEV_CLIENT
#ifdef EASYCAP_NEEDS_V4L2_FOPS
static const struct v4l2_file_operations v4l2_fops = { static const struct v4l2_file_operations v4l2_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = easycap_open_noinode, .open = easycap_open_noinode,
...@@ -3141,7 +3140,6 @@ static const struct v4l2_file_operations v4l2_fops = { ...@@ -3141,7 +3140,6 @@ static const struct v4l2_file_operations v4l2_fops = {
.poll = easycap_poll, .poll = easycap_poll,
.mmap = easycap_mmap, .mmap = easycap_mmap,
}; };
#endif /*EASYCAP_NEEDS_V4L2_FOPS*/
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/ #endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
/*****************************************************************************/ /*****************************************************************************/
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
...@@ -3184,9 +3182,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -3184,9 +3182,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
struct easycap_format *peasycap_format; struct easycap_format *peasycap_format;
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ /*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#ifdef EASYCAP_IS_VIDEODEV_CLIENT #ifdef EASYCAP_IS_VIDEODEV_CLIENT
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
struct v4l2_device *pv4l2_device; struct v4l2_device *pv4l2_device;
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/ #endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
...@@ -3289,10 +3285,8 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -3289,10 +3285,8 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
#ifdef EASYCAP_IS_VIDEODEV_CLIENT #ifdef EASYCAP_IS_VIDEODEV_CLIENT
SAM("where 0x%08lX=&peasycap->video_device\n", SAM("where 0x%08lX=&peasycap->video_device\n",
(unsigned long int) &peasycap->video_device); (unsigned long int) &peasycap->video_device);
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
SAM("and 0x%08lX=&peasycap->v4l2_device\n", SAM("and 0x%08lX=&peasycap->v4l2_device\n",
(unsigned long int) &peasycap->v4l2_device); (unsigned long int) &peasycap->v4l2_device);
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/ #endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
...@@ -3542,11 +3536,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -3542,11 +3536,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
bInterfaceNumber); bInterfaceNumber);
return -ENODEV; return -ENODEV;
} }
#ifndef EASYCAP_IS_VIDEODEV_CLIENT #ifdef EASYCAP_IS_VIDEODEV_CLIENT
#
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#else
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* /*
* SOME VERSIONS OF THE videodev MODULE OVERWRITE THE DATA WHICH HAS * SOME VERSIONS OF THE videodev MODULE OVERWRITE THE DATA WHICH HAS
...@@ -3564,7 +3554,6 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -3564,7 +3554,6 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
peasycap = (struct easycap *) peasycap = (struct easycap *)
container_of(pv4l2_device, struct easycap, v4l2_device); container_of(pv4l2_device, struct easycap, v4l2_device);
} }
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/ #endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
...@@ -4136,7 +4125,6 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -4136,7 +4125,6 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
} }
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ /*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#else #else
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
if (0 != (v4l2_device_register(&(pusb_interface->dev), if (0 != (v4l2_device_register(&(pusb_interface->dev),
&(peasycap->v4l2_device)))) { &(peasycap->v4l2_device)))) {
SAM("v4l2_device_register() failed\n"); SAM("v4l2_device_register() failed\n");
...@@ -4156,14 +4144,9 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -4156,14 +4144,9 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
peasycap->video_device.v4l2_dev = NULL; peasycap->video_device.v4l2_dev = NULL;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
strcpy(&peasycap->video_device.name[0], "easycapdc60"); strcpy(&peasycap->video_device.name[0], "easycapdc60");
#ifdef EASYCAP_NEEDS_V4L2_FOPS
peasycap->video_device.fops = &v4l2_fops; peasycap->video_device.fops = &v4l2_fops;
#else
peasycap->video_device.fops = &easycap_fops;
#endif /*EASYCAP_NEEDS_V4L2_FOPS*/
peasycap->video_device.minor = -1; peasycap->video_device.minor = -1;
peasycap->video_device.release = (void *)(&videodev_release); peasycap->video_device.release = (void *)(&videodev_release);
...@@ -4539,9 +4522,7 @@ static void easycap_usb_disconnect(struct usb_interface *pusb_interface) ...@@ -4539,9 +4522,7 @@ static void easycap_usb_disconnect(struct usb_interface *pusb_interface)
int minor, m, kd; int minor, m, kd;
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ /*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#ifdef EASYCAP_IS_VIDEODEV_CLIENT #ifdef EASYCAP_IS_VIDEODEV_CLIENT
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
struct v4l2_device *pv4l2_device; struct v4l2_device *pv4l2_device;
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/ #endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
...@@ -4571,7 +4552,6 @@ static void easycap_usb_disconnect(struct usb_interface *pusb_interface) ...@@ -4571,7 +4552,6 @@ static void easycap_usb_disconnect(struct usb_interface *pusb_interface)
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
#ifdef EASYCAP_IS_VIDEODEV_CLIENT #ifdef EASYCAP_IS_VIDEODEV_CLIENT
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* /*
* SOME VERSIONS OF THE videodev MODULE OVERWRITE THE DATA WHICH HAS * SOME VERSIONS OF THE videodev MODULE OVERWRITE THE DATA WHICH HAS
...@@ -4589,8 +4569,6 @@ static void easycap_usb_disconnect(struct usb_interface *pusb_interface) ...@@ -4589,8 +4569,6 @@ static void easycap_usb_disconnect(struct usb_interface *pusb_interface)
peasycap = (struct easycap *) peasycap = (struct easycap *)
container_of(pv4l2_device, struct easycap, v4l2_device); container_of(pv4l2_device, struct easycap, v4l2_device);
} }
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
#
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/ #endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
...@@ -4689,7 +4667,6 @@ case 0: { ...@@ -4689,7 +4667,6 @@ case 0: {
} }
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ /*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#else #else
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
if (!peasycap->v4l2_device.name[0]) { if (!peasycap->v4l2_device.name[0]) {
SAM("ERROR: peasycap->v4l2_device.name is empty\n"); SAM("ERROR: peasycap->v4l2_device.name is empty\n");
if (0 <= kd && DONGLE_MANY > kd) if (0 <= kd && DONGLE_MANY > kd)
...@@ -4700,7 +4677,6 @@ case 0: { ...@@ -4700,7 +4677,6 @@ case 0: {
JOM(4, "v4l2_device_disconnect() OK\n"); JOM(4, "v4l2_device_disconnect() OK\n");
v4l2_device_unregister(&peasycap->v4l2_device); v4l2_device_unregister(&peasycap->v4l2_device);
JOM(4, "v4l2_device_unregister() OK\n"); JOM(4, "v4l2_device_unregister() OK\n");
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
video_unregister_device(&peasycap->video_device); video_unregister_device(&peasycap->video_device);
JOM(4, "intf[%i]: video_unregister_device() OK\n", bInterfaceNumber); JOM(4, "intf[%i]: video_unregister_device() OK\n", bInterfaceNumber);
......
...@@ -308,9 +308,7 @@ struct easycap *peasycap; ...@@ -308,9 +308,7 @@ struct easycap *peasycap;
int subminor; int subminor;
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ /*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#ifdef EASYCAP_IS_VIDEODEV_CLIENT #ifdef EASYCAP_IS_VIDEODEV_CLIENT
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
struct v4l2_device *pv4l2_device; struct v4l2_device *pv4l2_device;
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/ #endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
...@@ -331,11 +329,7 @@ if (NULL == peasycap) { ...@@ -331,11 +329,7 @@ if (NULL == peasycap) {
return -1; return -1;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
#ifndef EASYCAP_IS_VIDEODEV_CLIENT #ifdef EASYCAP_IS_VIDEODEV_CLIENT
#
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#else
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* /*
* SOME VERSIONS OF THE videodev MODULE OVERWRITE THE DATA WHICH HAS * SOME VERSIONS OF THE videodev MODULE OVERWRITE THE DATA WHICH HAS
...@@ -353,8 +347,6 @@ if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) { ...@@ -353,8 +347,6 @@ if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) {
peasycap = (struct easycap *) peasycap = (struct easycap *)
container_of(pv4l2_device, struct easycap, v4l2_device); container_of(pv4l2_device, struct easycap, v4l2_device);
} }
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
#
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/ #endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment