summaryrefslogtreecommitdiff
path: root/v4l/scripts/make_config_compat.pl
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@kernellabs.com>2009-09-15 11:14:17 -0400
committerMichael Krufky <mkrufky@kernellabs.com>2009-09-15 11:14:17 -0400
commitb0d1e983e98ec9b72146c16d08b3409a418c62df (patch)
treeb61e50f54f11599f31b476c477a69883597f5fad /v4l/scripts/make_config_compat.pl
parent2c16279409d239adbbc884a308e71264ea02ef46 (diff)
parent219fe38bd79dab42db83cacc1f5444d0e27fa8ea (diff)
downloadmediapointer-dvb-s2-b0d1e983e98ec9b72146c16d08b3409a418c62df.tar.gz
mediapointer-dvb-s2-b0d1e983e98ec9b72146c16d08b3409a418c62df.tar.bz2
merge: ~mkrufky/tda18271
From: Michael Krufky <mkrufky@kernellabs.com> Priority: normal Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Diffstat (limited to 'v4l/scripts/make_config_compat.pl')
-rwxr-xr-xv4l/scripts/make_config_compat.pl129
1 files changed, 119 insertions, 10 deletions
diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl
index 423dcff77..1f5b8bae6 100755
--- a/v4l/scripts/make_config_compat.pl
+++ b/v4l/scripts/make_config_compat.pl
@@ -218,40 +218,144 @@ sub check_net_dev()
sub check_usb_endpoint_type()
{
- my $file = "$kdir/include/linux/usb.h";
+ my $nfiles = 0;
+ my @files = ( "$kdir/include/linux/usb.h", "$kdir/include/linux/usb/ch9.h" );
+
+ foreach my $file ( @files ) {
+ open IN, "<$file" or next;
+ $nfiles++;
+ while (<IN>) {
+ if (m/usb_endpoint_type/) {
+ close IN;
+ # definition found. No need for compat
+ return;
+ }
+ }
+ close IN;
+ }
+
+ die "Usb headers not found" if (!$nfiles);
+
+ # definition not found. This means that we need compat
+ $out.= "\n#define NEED_USB_ENDPOINT_TYPE 1\n";
+}
+
+sub check_pci_ioremap_bar()
+{
+ my $file = "$kdir/include/linux/pci.h";
my $need_compat = 1;
open INNET, "<$file" or die "File not found: $file";
while (<INNET>) {
- if (m/usb_endpoint_type/) {
+ if (m/pci_ioremap_bar/) {
$need_compat = 0;
last;
}
}
if ($need_compat) {
- $out.= "\n#define NEED_USB_ENDPOINT_TYPE 1\n";
+ $out.= "\n#define NEED_PCI_IOREMAP_BAR 1\n";
}
close INNET;
}
-sub check_pci_ioremap_bar()
+sub check_snd_card_create()
{
- my $file = "$kdir/include/linux/pci.h";
+ my $file = "$kdir/include/sound/core.h";
my $need_compat = 1;
- open INNET, "<$file" or die "File not found: $file";
- while (<INNET>) {
- if (m/pci_ioremap_bar/) {
+ open IN, "<$file" or die "File not found: $file";
+ while (<IN>) {
+ if (m/snd_card_create/) {
$need_compat = 0;
last;
}
}
if ($need_compat) {
- $out.= "\n#define NEED_PCI_IOREMAP_BAR 1\n";
+ $out.= "\n#define NEED_SND_CARD_CREATE\n";
}
- close INNET;
+ close IN;
+}
+
+sub check_poll_schedule()
+{
+ my @files = ( "$kdir/include/linux/poll.h" );
+
+ foreach my $file ( @files ) {
+ open IN, "<$file" or die "File not found: $file";
+ while (<IN>) {
+ if (m/poll_schedule/) {
+ close IN;
+ # definition found. No need for compat
+ return;
+ }
+ }
+ close IN;
+ }
+
+ # definition not found. This means that we need compat
+ $out.= "\n#define NEED_POLL_SCHEDULE 1\n";
+}
+
+sub check_snd_BUG_ON()
+{
+ my @files = ( "$kdir/include/sound/core.h" );
+
+ foreach my $file ( @files ) {
+ open IN, "<$file" or die "File not found: $file";
+ while (<IN>) {
+ if (m/snd_BUG_ON/) {
+ close IN;
+ # definition found. No need for compat
+ return;
+ }
+ }
+ close IN;
+ }
+
+ # definition not found. This means that we need compat
+ $out.= "\n#define NEED_SND_BUG_ON 1\n";
+}
+
+sub check_bitops()
+{
+ my @files = ( "$kdir/include/linux/bitops.h" );
+
+ foreach my $file ( @files ) {
+ open IN, "<$file" or next;
+ while (<IN>) {
+ if (m/#define\s+BIT\(/) {
+ close IN;
+ # definition found. No need for compat
+ return;
+ }
+ }
+ close IN;
+ }
+
+ # definition not found. This means that we need compat
+ $out.= "\n#define NEED_BITOPS 1\n";
+}
+
+sub check_delayed_work()
+{
+ my @files = ( "$kdir//include/linux/workqueue.h" );
+
+ foreach my $file ( @files ) {
+ open IN, "<$file" or die "File not found: $file";
+ while (<IN>) {
+ if (m/struct\s+delayed_work/) {
+ close IN;
+ # definition found. No need for compat
+ return;
+ }
+ }
+ close IN;
+ }
+
+ # definition not found. This means that we need compat
+ $out.= "\n#define NEED_DELAYED_WORK 1\n";
}
sub check_other_dependencies()
@@ -269,6 +373,11 @@ sub check_other_dependencies()
check_net_dev();
check_usb_endpoint_type();
check_pci_ioremap_bar();
+ check_snd_card_create();
+ check_poll_schedule();
+ check_snd_BUG_ON();
+ check_bitops();
+ check_delayed_work();
}
# Do the basic rules