summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--v4l/compat.h2
-rwxr-xr-xv4l/scripts/make_config_compat.pl23
2 files changed, 24 insertions, 1 deletions
diff --git a/v4l/compat.h b/v4l/compat.h
index 34ae08152..d8bd6debe 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -427,7 +427,7 @@ static inline int usb_endpoint_type(const struct usb_endpoint_descriptor *epd)
pci_resource_len(pdev, bar))
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
+#ifdef NEED_POLL_SCHEDULE
#define poll_schedule(pwq, task) \
do { \
set_current_state(task); \
diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl
index e94bf2803..32b111f4e 100755
--- a/v4l/scripts/make_config_compat.pl
+++ b/v4l/scripts/make_config_compat.pl
@@ -274,6 +274,28 @@ sub check_snd_card_create()
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_other_dependencies()
{
check_spin_lock();
@@ -290,6 +312,7 @@ sub check_other_dependencies()
check_usb_endpoint_type();
check_pci_ioremap_bar();
check_snd_card_create();
+ check_poll_schedule();
}
# Do the basic rules