diff options
Diffstat (limited to 'v4l')
-rw-r--r-- | v4l/compat.h | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | v4l/scripts/make_config_compat.pl | 20 |
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 |