summaryrefslogtreecommitdiff
path: root/v4l
diff options
context:
space:
mode:
Diffstat (limited to 'v4l')
-rw-r--r--v4l/compat.h17
-rwxr-xr-xv4l/scripts/make_config_compat.pl20
2 files changed, 37 insertions, 0 deletions
diff --git a/v4l/compat.h b/v4l/compat.h
index 8e778d7f5..34ae08152 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -36,6 +36,10 @@
#include <sound/driver.h>
#endif
+#ifdef NEED_SND_CARD_CREATE
+#include <sound/core.h>
+#endif
+
#ifdef NEED_ALGO_CONTROL
#include <linux/i2c.h>
#endif
@@ -432,4 +436,17 @@ static inline int usb_endpoint_type(const struct usb_endpoint_descriptor *epd)
} while (0)
#endif
+#ifdef NEED_SND_CARD_CREATE
+static inline int snd_card_create(int idx, const char *id,
+ struct module *module, int extra_size,
+ struct snd_card **card)
+{
+ *card = snd_card_new(idx, id, module, extra_size);
+
+ if (*card == NULL)
+ return -ENOMEM;
+ return 0;
+}
#endif
+
+#endif /* _COMPAT_H */
diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl
index 423dcff77..2fc37d06d 100755
--- a/v4l/scripts/make_config_compat.pl
+++ b/v4l/scripts/make_config_compat.pl
@@ -254,6 +254,25 @@ sub check_pci_ioremap_bar()
close INNET;
}
+sub check_snd_card_create()
+{
+ my $file = "$kdir/include/sound/core.h";
+ my $need_compat = 1;
+
+ 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_SND_CARD_CREATE\n";
+ }
+ close IN;
+}
+
sub check_other_dependencies()
{
check_spin_lock();
@@ -269,6 +288,7 @@ sub check_other_dependencies()
check_net_dev();
check_usb_endpoint_type();
check_pci_ioremap_bar();
+ check_snd_card_create();
}
# Do the basic rules