From d54ae5db8294db9af22f394d69591b8cf500ddc8 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 14 Apr 2009 11:11:08 -0300 Subject: Fix compatibility for usb_endpoint_type and 2.6.30 From: Mauro Carvalho Chehab compat.h: usb_endpoint_type can be found on ch9.h header Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/make_config_compat.pl | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl index 2fc37d06d..e94bf2803 100755 --- a/v4l/scripts/make_config_compat.pl +++ b/v4l/scripts/make_config_compat.pl @@ -218,21 +218,22 @@ sub check_net_dev() sub check_usb_endpoint_type() { - my $file = "$kdir/include/linux/usb.h"; - my $need_compat = 1; - - open INNET, "<$file" or die "File not found: $file"; - while () { - if (m/usb_endpoint_type/) { - $need_compat = 0; - last; + my @files = ( "$kdir/include/linux/usb.h", "$kdir/include/linux/usb/ch9.h" ); + + foreach my $file ( @files ) { + open IN, "<$file" or die "File not found: $file"; + while () { + if (m/usb_endpoint_type/) { + close IN; + # definition found. No need for compat + return; + } } + close IN; } - if ($need_compat) { - $out.= "\n#define NEED_USB_ENDPOINT_TYPE 1\n"; - } - close INNET; + # definition not found. This means that we need compat + $out.= "\n#define NEED_USB_ENDPOINT_TYPE 1\n"; } sub check_pci_ioremap_bar() -- cgit v1.2.3