* Re: [hg:v4l-dvb] gspca - main: Fix a compile error when CONFIG_INPUT is not set
[not found] <E1Nmblu-0007t3-Dm@www.linuxtv.org>
@ 2010-03-03 8:51 ` Jean-Francois Moine
2010-03-03 16:19 ` Douglas Schilling Landgraf
0 siblings, 1 reply; 3+ messages in thread
From: Jean-Francois Moine @ 2010-03-03 8:51 UTC (permalink / raw)
To: linux-media, Douglas Schilling Landgraf; +Cc: Mauro Carvalho Chehab
[-- Attachment #1: Type: text/plain, Size: 3206 bytes --]
On Wed, 03 Mar 2010 00:45:02 +0100
Patch from Jean-Fran?ois Moine <hg-commit@linuxtv.org> wrote:
> The patch number 14343 was added via Douglas Schilling Landgraf
> <dougsland@redhat.com> to http://linuxtv.org/hg/v4l-dvb master
> development tree.
>
> Kernel patches in this development tree may be modified to be backward
> compatible with older kernels. Compatibility modifications will be
> removed before inclusion into the mainstream Kernel
>
> If anyone has any objections, please let us know by sending a message
> to: Linux Media Mailing List <linux-media@vger.kernel.org>
>
> ------
>
> From: Jean-Fran?ois Moine <moinejf@free.fr>
> gspca - main: Fix a compile error when CONFIG_INPUT is not set
>
>
> Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
>
> Priority: normal
>
> [dougsland@redhat.com: patch backported to hg tree]
> Signed-off-by: Jean-Fran?ois Moine <moinejf@free.fr>
> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
>
>
> ---
>
> linux/drivers/media/video/gspca/gspca.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff -r c533329e3c41 -r 6519c63ecf6d
> linux/drivers/media/video/gspca/gspca.c ---
> a/linux/drivers/media/video/gspca/gspca.c Tue Mar 02 20:16:17
> 2010 -0300 +++ b/linux/drivers/media/video/gspca/gspca.c Tue
> Mar 02 20:38:01 2010 -0300 @@ -44,10 +44,12 @@
> #include "gspca.h"
>
> +#ifdef CONFIG_INPUT
> #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
> #include <linux/input.h>
> #include <linux/usb/input.h>
> #endif
> +#endif
>
> /* global values */
> #define DEF_NURBS 3 /* default number of URBs */
> @@ -2371,9 +2373,11 @@
> void gspca_disconnect(struct usb_interface *intf)
> {
> struct gspca_dev *gspca_dev = usb_get_intfdata(intf);
> +#ifdef CONFIG_INPUT
> #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
> struct input_dev *input_dev;
> #endif
> +#endif
>
> PDEBUG(D_PROBE, "%s disconnect",
> video_device_node_name(&gspca_dev->vdev));
> @@ -2385,6 +2389,7 @@
> wake_up_interruptible(&gspca_dev->wq);
> }
>
> +#ifdef CONFIG_INPUT
> #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
> gspca_input_destroy_urb(gspca_dev);
> input_dev = gspca_dev->input_dev;
> @@ -2393,6 +2398,7 @@
> input_unregister_device(input_dev);
> }
> #endif
> +#endif
>
> /* the device is freed at exit of this function */
> gspca_dev->dev = NULL;
>
>
> ---
>
> Patch is available at:
> http://linuxtv.org/hg/v4l-dvb/rev/6519c63ecf6d4e7e2c1c3d46ac2a161da8d6c6f4
Hello Douglas,
I do not understand your patch. Do you mean that the input events
cannot be used with kernel < 2.6.19, while CONFIG_INPUT can be set?
Anyway, this patch seems complex. It would have been easier to simply
unset CONFIG_INPUT when kernel < 2.6.19.
I join the diff of gspca.c between v4l-dvb and my repository. This last
one is closer to the git version and there are still other changes done
in git. How do you think I should merge?
Cheers.
--
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/
[-- Attachment #2: gspca.dif --]
[-- Type: application/octet-stream, Size: 3596 bytes --]
--- /tmp/gspca.c~other.0wSSrD 2010-03-03 09:17:29.000000000 +0100
+++ linux/drivers/media/video/gspca/gspca.c 2010-03-03 09:17:29.000000000 +0100
@@ -45,11 +45,9 @@
#include "gspca.h"
#ifdef CONFIG_INPUT
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
#include <linux/input.h>
#include <linux/usb/input.h>
#endif
-#endif
/* global values */
#define DEF_NURBS 3 /* default number of URBs */
@@ -126,8 +124,11 @@
* Input and interrupt endpoint handling functions
*/
#ifdef CONFIG_INPUT
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)
+static void int_irq(struct urb *urb, struct pt_regs *regs)
+#else
static void int_irq(struct urb *urb)
+#endif
{
struct gspca_dev *gspca_dev = (struct gspca_dev *) urb->context;
int ret;
@@ -306,7 +307,6 @@
#define gspca_input_create_urb(gspca_dev) 0
#define gspca_input_destroy_urb(gspca_dev)
#endif
-#endif
/* get the current input frame buffer */
struct gspca_frame *gspca_get_i_frame(struct gspca_dev *gspca_dev)
@@ -695,21 +695,13 @@
i, ep->desc.bEndpointAddress);
gspca_dev->alt = i; /* memorize the current alt setting */
if (gspca_dev->nbalt > 1) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
gspca_input_destroy_urb(gspca_dev);
-#endif
ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, i);
if (ret < 0) {
err("set alt %d err %d", i, ret);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
ep = NULL;
-#else
- return NULL;
-#endif
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
gspca_input_create_urb(gspca_dev);
-#endif
}
return ep;
}
@@ -920,13 +912,9 @@
if (gspca_dev->sd_desc->stopN)
gspca_dev->sd_desc->stopN(gspca_dev);
destroy_urbs(gspca_dev);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
gspca_input_destroy_urb(gspca_dev);
-#endif
gspca_set_alt0(gspca_dev);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
gspca_input_create_urb(gspca_dev);
-#endif
}
/* always call stop0 to free the subdriver's resources */
@@ -2350,11 +2338,9 @@
usb_set_intfdata(intf, gspca_dev);
PDEBUG(D_PROBE, "%s created", video_device_node_name(&gspca_dev->vdev));
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
ret = gspca_input_connect(gspca_dev);
if (ret == 0)
ret = gspca_input_create_urb(gspca_dev);
-#endif
return 0;
out:
@@ -2374,10 +2360,8 @@
{
struct gspca_dev *gspca_dev = usb_get_intfdata(intf);
#ifdef CONFIG_INPUT
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
struct input_dev *input_dev;
#endif
-#endif
PDEBUG(D_PROBE, "%s disconnect",
video_device_node_name(&gspca_dev->vdev));
@@ -2390,7 +2374,6 @@
}
#ifdef CONFIG_INPUT
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
gspca_input_destroy_urb(gspca_dev);
input_dev = gspca_dev->input_dev;
if (input_dev) {
@@ -2398,7 +2381,6 @@
input_unregister_device(input_dev);
}
#endif
-#endif
/* the device is freed at exit of this function */
gspca_dev->dev = NULL;
@@ -2425,9 +2407,7 @@
if (gspca_dev->sd_desc->stopN)
gspca_dev->sd_desc->stopN(gspca_dev);
destroy_urbs(gspca_dev);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
gspca_input_destroy_urb(gspca_dev);
-#endif
gspca_set_alt0(gspca_dev);
if (gspca_dev->sd_desc->stop0)
gspca_dev->sd_desc->stop0(gspca_dev);
@@ -2441,9 +2421,7 @@
gspca_dev->frozen = 0;
gspca_dev->sd_desc->init(gspca_dev);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
gspca_input_create_urb(gspca_dev);
-#endif
if (gspca_dev->streaming)
return gspca_init_transfer(gspca_dev);
return 0;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [hg:v4l-dvb] gspca - main: Fix a compile error when CONFIG_INPUT is not set
2010-03-03 8:51 ` [hg:v4l-dvb] gspca - main: Fix a compile error when CONFIG_INPUT is not set Jean-Francois Moine
@ 2010-03-03 16:19 ` Douglas Schilling Landgraf
2010-03-04 8:55 ` Douglas Schilling Landgraf
0 siblings, 1 reply; 3+ messages in thread
From: Douglas Schilling Landgraf @ 2010-03-03 16:19 UTC (permalink / raw)
To: Jean-Francois Moine; +Cc: linux-media, Mauro Carvalho Chehab
Hi,
Jean-Francois Moine wrote:
> On Wed, 03 Mar 2010 00:45:02 +0100
> Patch from Jean-Fran?ois Moine <hg-commit@linuxtv.org> wrote:
>
>> The patch number 14343 was added via Douglas Schilling Landgraf
>> <dougsland@redhat.com> to http://linuxtv.org/hg/v4l-dvb master
>> development tree.
>>
>> Kernel patches in this development tree may be modified to be backward
>> compatible with older kernels. Compatibility modifications will be
>> removed before inclusion into the mainstream Kernel
>>
>> If anyone has any objections, please let us know by sending a message
>> to: Linux Media Mailing List <linux-media@vger.kernel.org>
>>
>> ------
>>
>> From: Jean-Fran?ois Moine <moinejf@free.fr>
>> gspca - main: Fix a compile error when CONFIG_INPUT is not set
>>
>>
>> Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
>>
>> Priority: normal
>>
>> [dougsland@redhat.com: patch backported to hg tree]
>> Signed-off-by: Jean-Fran?ois Moine <moinejf@free.fr>
>> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
>> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
>>
>>
>> ---
>>
>> linux/drivers/media/video/gspca/gspca.c | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff -r c533329e3c41 -r 6519c63ecf6d
>> linux/drivers/media/video/gspca/gspca.c ---
>> a/linux/drivers/media/video/gspca/gspca.c Tue Mar 02 20:16:17
>> 2010 -0300 +++ b/linux/drivers/media/video/gspca/gspca.c Tue
>> Mar 02 20:38:01 2010 -0300 @@ -44,10 +44,12 @@
>> #include "gspca.h"
>>
>> +#ifdef CONFIG_INPUT
>> #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
>> #include <linux/input.h>
>> #include <linux/usb/input.h>
>> #endif
>> +#endif
>>
>> /* global values */
>> #define DEF_NURBS 3 /* default number of URBs */
>> @@ -2371,9 +2373,11 @@
>> void gspca_disconnect(struct usb_interface *intf)
>> {
>> struct gspca_dev *gspca_dev = usb_get_intfdata(intf);
>> +#ifdef CONFIG_INPUT
>> #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
>> struct input_dev *input_dev;
>> #endif
>> +#endif
>>
>> PDEBUG(D_PROBE, "%s disconnect",
>> video_device_node_name(&gspca_dev->vdev));
>> @@ -2385,6 +2389,7 @@
>> wake_up_interruptible(&gspca_dev->wq);
>> }
>>
>> +#ifdef CONFIG_INPUT
>> #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
>> gspca_input_destroy_urb(gspca_dev);
>> input_dev = gspca_dev->input_dev;
>> @@ -2393,6 +2398,7 @@
>> input_unregister_device(input_dev);
>> }
>> #endif
>> +#endif
>>
>> /* the device is freed at exit of this function */
>> gspca_dev->dev = NULL;
>>
>>
>> ---
>>
>> Patch is available at:
>> http://linuxtv.org/hg/v4l-dvb/rev/6519c63ecf6d4e7e2c1c3d46ac2a161da8d6c6f4
>
> Hello Douglas,
>
> I do not understand your patch. Do you mean that the input events
> cannot be used with kernel < 2.6.19, while CONFIG_INPUT can be set?
>
> Anyway, this patch seems complex. It would have been easier to simply
> unset CONFIG_INPUT when kernel < 2.6.19.
Agreed. Anyway, there are parts which still need CONFIG_INPUT if we want
to remove the kernel check. Going to review this one.
> I join the diff of gspca.c between v4l-dvb and my repository. This last
> one is closer to the git version and there are still other changes done
> in git. How do you think I should merge?
If I understand your question correctly, the better way is wait until I
complete the merge between git and hg which I intend to complete today
and then merge the hg trees. I will give you a note.
Cheers
Douglas
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [hg:v4l-dvb] gspca - main: Fix a compile error when CONFIG_INPUT is not set
2010-03-03 16:19 ` Douglas Schilling Landgraf
@ 2010-03-04 8:55 ` Douglas Schilling Landgraf
0 siblings, 0 replies; 3+ messages in thread
From: Douglas Schilling Landgraf @ 2010-03-04 8:55 UTC (permalink / raw)
To: dougsland; +Cc: Jean-Francois Moine, linux-media, Mauro Carvalho Chehab
Hello Jean,
On 03/03/2010 11:19 AM, Douglas Schilling Landgraf wrote:
> Hi,
>
> Jean-Francois Moine wrote:
>> On Wed, 03 Mar 2010 00:45:02 +0100
>> Patch from Jean-Fran?ois Moine <hg-commit@linuxtv.org> wrote:
>>
>>> The patch number 14343 was added via Douglas Schilling Landgraf
>>> <dougsland@redhat.com> to http://linuxtv.org/hg/v4l-dvb master
>>> development tree.
>>>
>>> Kernel patches in this development tree may be modified to be backward
>>> compatible with older kernels. Compatibility modifications will be
>>> removed before inclusion into the mainstream Kernel
>>>
>>> If anyone has any objections, please let us know by sending a message
>>> to: Linux Media Mailing List <linux-media@vger.kernel.org>
>>>
>>> ------
>>>
>>> From: Jean-Fran?ois Moine <moinejf@free.fr>
>>> gspca - main: Fix a compile error when CONFIG_INPUT is not set
>>>
>>>
>>> Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
>>>
>>> Priority: normal
>>>
>>> [dougsland@redhat.com: patch backported to hg tree]
>>> Signed-off-by: Jean-Fran?ois Moine <moinejf@free.fr>
>>> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
>>> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
>>>
>>>
>>> ---
>>>
>>> linux/drivers/media/video/gspca/gspca.c | 6 ++++++
>>> 1 file changed, 6 insertions(+)
>>>
>>> diff -r c533329e3c41 -r 6519c63ecf6d
>>> linux/drivers/media/video/gspca/gspca.c ---
>>> a/linux/drivers/media/video/gspca/gspca.c Tue Mar 02 20:16:17
>>> 2010 -0300 +++ b/linux/drivers/media/video/gspca/gspca.c Tue
>>> Mar 02 20:38:01 2010 -0300 @@ -44,10 +44,12 @@ #include "gspca.h"
>>>
>>> +#ifdef CONFIG_INPUT
>>> #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
>>> #include <linux/input.h>
>>> #include <linux/usb/input.h>
>>> #endif
>>> +#endif
>>>
>>> /* global values */
>>> #define DEF_NURBS 3 /* default number of URBs */
>>> @@ -2371,9 +2373,11 @@
>>> void gspca_disconnect(struct usb_interface *intf)
>>> {
>>> struct gspca_dev *gspca_dev = usb_get_intfdata(intf);
>>> +#ifdef CONFIG_INPUT
>>> #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
>>> struct input_dev *input_dev;
>>> #endif
>>> +#endif
>>>
>>> PDEBUG(D_PROBE, "%s disconnect",
>>> video_device_node_name(&gspca_dev->vdev));
>>> @@ -2385,6 +2389,7 @@
>>> wake_up_interruptible(&gspca_dev->wq);
>>> }
>>>
>>> +#ifdef CONFIG_INPUT
>>> #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
>>> gspca_input_destroy_urb(gspca_dev);
>>> input_dev = gspca_dev->input_dev;
>>> @@ -2393,6 +2398,7 @@
>>> input_unregister_device(input_dev);
>>> }
>>> #endif
>>> +#endif
>>>
>>> /* the device is freed at exit of this function */
>>> gspca_dev->dev = NULL;
>>>
>>>
>>> ---
>>>
>>> Patch is available at:
>>> http://linuxtv.org/hg/v4l-dvb/rev/6519c63ecf6d4e7e2c1c3d46ac2a161da8d6c6f4
>>>
>>
>> Hello Douglas,
>>
>> I do not understand your patch. Do you mean that the input events
>> cannot be used with kernel < 2.6.19, while CONFIG_INPUT can be set?
> >
>> Anyway, this patch seems complex. It would have been easier to simply
>> unset CONFIG_INPUT when kernel < 2.6.19.
>
> Agreed. Anyway, there are parts which still need CONFIG_INPUT if we
> want to remove the kernel check. Going to review this one.
>
>> I join the diff of gspca.c between v4l-dvb and my repository. This last
>> one is closer to the git version and there are still other changes done
>> in git. How do you think I should merge?
>
> If I understand your question correctly, the better way is wait until
> I complete the merge between git and hg which I intend to complete
> today and then merge the hg trees. I will give you a note.
>
git and hg are synced, now I will work about compatible items in the tree.
Cheers
Douglas
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-03-04 5:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <E1Nmblu-0007t3-Dm@www.linuxtv.org>
2010-03-03 8:51 ` [hg:v4l-dvb] gspca - main: Fix a compile error when CONFIG_INPUT is not set Jean-Francois Moine
2010-03-03 16:19 ` Douglas Schilling Landgraf
2010-03-04 8:55 ` Douglas Schilling Landgraf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.