summaryrefslogtreecommitdiff
path: root/v4l
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-10-18 16:25:58 -0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-18 16:25:58 -0200
commit7c3206d14cea8962f79628f11cd3f582f2b9644d (patch)
tree97bf97a6e862f4ac2ef10c7fb489727422437196 /v4l
parenta62117aed50a2e1370520066d61db0dc3e040c49 (diff)
downloadmediapointer-dvb-s2-7c3206d14cea8962f79628f11cd3f582f2b9644d.tar.gz
mediapointer-dvb-s2-7c3206d14cea8962f79628f11cd3f582f2b9644d.tar.bz2
Fix compilation for distro kernels with newer -ALSA trees
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l')
-rw-r--r--v4l/compat.h2
-rwxr-xr-x[-rw-r--r--]v4l/scripts/make_config_compat.pl20
2 files changed, 21 insertions, 1 deletions
diff --git a/v4l/compat.h b/v4l/compat.h
index 97b35d4f7..db45d91f0 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -447,7 +447,7 @@ static inline u8 v4l_compat_pci_rev(struct pci_dev *pci)
# endif
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) && defined(__SOUND_PCM_H)
+#if defined(COMPAT_PCM_TO_RATE_BIT) && defined(__SOUND_PCM_H)
/* New alsa core utility function */
static inline unsigned int snd_pcm_rate_to_rate_bit(unsigned int rate)
{
diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl
index 21dce0126..785f9ff72 100644..100755
--- a/v4l/scripts/make_config_compat.pl
+++ b/v4l/scripts/make_config_compat.pl
@@ -26,6 +26,25 @@ sub check_spin_lock()
close INNET;
}
+sub check_snd_pcm_rate_to_rate_bit()
+{
+ my $file = "$kdir/include/sound/pcm.h";
+ my $old_syntax = 1;
+
+ open INNET, "<$file" or die "File not found: $file";
+ while (<INNET>) {
+ if (m/snd_pcm_rate_to_rate_bit/) {
+ $old_syntax = 0;
+ last;
+ }
+ }
+
+ if ($old_syntax) {
+ $out.= "\n#define COMPAT_PCM_TO_RATE_BIT 1\n";
+ }
+ close INNET;
+}
+
sub check_snd_ctl_boolean_mono_info()
{
my $file = "$kdir/include/sound/control.h";
@@ -49,6 +68,7 @@ sub check_other_dependencies()
{
check_spin_lock();
check_snd_ctl_boolean_mono_info();
+ check_snd_pcm_rate_to_rate_bit();
}
# Do the basic rules