diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-04-14 11:02:14 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-04-14 11:02:14 -0300 |
commit | 82753c8a0c338f489a20e0554eac589a390ac6bb (patch) | |
tree | a2134f320a14a29211a191b23d3ecef65ea5898a /v4l | |
parent | 2ec15a3bdd5af9a1ba399e60653b25cd322852e0 (diff) | |
download | mediapointer-dvb-s2-82753c8a0c338f489a20e0554eac589a390ac6bb.tar.gz mediapointer-dvb-s2-82753c8a0c338f489a20e0554eac589a390ac6bb.tar.bz2 |
backport commit 758021bfa9ea25c58e62d2f68512628b19502ce7
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Author: Takashi Iwai <tiwai@suse.de>
Date: Mon Jan 12 15:17:09 2009 +0100
drivers/media: Convert to snd_card_create()
Convert from snd_card_new() to the new snd_card_create() function.
While here, backport also cx231xx-audio upstream changes for using
snd_card_create().
kernel-sync:
Priority: normal
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'v4l')
-rw-r--r-- | v4l/compat.h | 17 | ||||
-rwxr-xr-x | v4l/scripts/make_config_compat.pl | 20 |
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 |