summaryrefslogtreecommitdiff
path: root/v4l
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-06-30 16:16:36 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-30 16:16:36 -0300
commit221de1811057eaf48622305801e647be600b12f5 (patch)
treeaf5b7704e7406588bfa8050ce5097d8074accee5 /v4l
parentf3e605bcc7d54a437e0d179042c0ce2890eee348 (diff)
parentc51edc01bc32d6994c8499a7d72f11170f83c378 (diff)
downloadmediapointer-dvb-s2-221de1811057eaf48622305801e647be600b12f5.tar.gz
mediapointer-dvb-s2-221de1811057eaf48622305801e647be600b12f5.tar.bz2
merge: http://www.linuxtv.org/hg/~hverkuil/v4l-dvb-misc
From: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'v4l')
-rw-r--r--v4l/compat.h2
-rwxr-xr-xv4l/scripts/make_config_compat.pl21
2 files changed, 22 insertions, 1 deletions
diff --git a/v4l/compat.h b/v4l/compat.h
index 56eb30853..11dc57109 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -9,7 +9,7 @@
* non-delayed work and struct delayed_work was created for delayed work. This
* will rename the structures. Hopefully no one will decide to name something
* delayed_work in the same context as something named work_struct. */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
+#ifdef NEED_DELAYED_WORK
#define delayed_work work_struct
#define INIT_DELAYED_WORK(a,b,c) INIT_WORK(a,b,c)
#endif
diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl
index 7c7841459..1f5b8bae6 100755
--- a/v4l/scripts/make_config_compat.pl
+++ b/v4l/scripts/make_config_compat.pl
@@ -338,6 +338,26 @@ sub check_bitops()
$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()
{
check_spin_lock();
@@ -357,6 +377,7 @@ sub check_other_dependencies()
check_poll_schedule();
check_snd_BUG_ON();
check_bitops();
+ check_delayed_work();
}
# Do the basic rules