summaryrefslogtreecommitdiff
path: root/include/sound/core.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@alsa3.local>2008-12-28 16:32:08 +0100
committerTakashi Iwai <tiwai@suse.de>2009-01-12 14:56:41 +0100
commit53fb1e63599438bd5f6fbb852023d80916d83983 (patch)
tree9fdf278a517805b11a977ce69ffbf61298ba0aac /include/sound/core.h
parentc59765042f53a79a7a65585042ff463b69cb248c (diff)
ALSA: Introduce snd_card_create()
Introduced snd_card_create() function as a replacement of snd_card_new(). The new function returns a negative error code so that the probe callback can return the proper error code, while snd_card_new() can give only NULL check. The old snd_card_new() is still provided as an inline function but with __deprecated attribute. It'll be removed soon later. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound/core.h')
-rw-r--r--include/sound/core.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/sound/core.h b/include/sound/core.h
index f632484bc743..25420c3b5513 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -296,8 +296,20 @@ int snd_card_locked(int card);
extern int (*snd_mixer_oss_notify_callback)(struct snd_card *card, int cmd);
#endif
+int snd_card_create(int idx, const char *id,
+ struct module *module, int extra_size,
+ struct snd_card **card_ret);
+
+static inline __deprecated
struct snd_card *snd_card_new(int idx, const char *id,
- struct module *module, int extra_size);
+ struct module *module, int extra_size)
+{
+ struct snd_card *card;
+ if (snd_card_create(idx, id, module, extra_size, &card) < 0)
+ return NULL;
+ return card;
+}
+
int snd_card_disconnect(struct snd_card *card);
int snd_card_free(struct snd_card *card);
int snd_card_free_when_closed(struct snd_card *card);