diff options
author | Takashi Iwai <tiwai@alsa3.local> | 2008-12-28 10:32:08 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-01-12 08:56:41 -0500 |
commit | 53fb1e63599438bd5f6fbb852023d80916d83983 (patch) | |
tree | 9fdf278a517805b11a977ce69ffbf61298ba0aac /include/sound | |
parent | c59765042f53a79a7a65585042ff463b69cb248c (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')
-rw-r--r-- | include/sound/core.h | 14 |
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); | |||
296 | extern int (*snd_mixer_oss_notify_callback)(struct snd_card *card, int cmd); | 296 | extern int (*snd_mixer_oss_notify_callback)(struct snd_card *card, int cmd); |
297 | #endif | 297 | #endif |
298 | 298 | ||
299 | int snd_card_create(int idx, const char *id, | ||
300 | struct module *module, int extra_size, | ||
301 | struct snd_card **card_ret); | ||
302 | |||
303 | static inline __deprecated | ||
299 | struct snd_card *snd_card_new(int idx, const char *id, | 304 | struct snd_card *snd_card_new(int idx, const char *id, |
300 | struct module *module, int extra_size); | 305 | struct module *module, int extra_size) |
306 | { | ||
307 | struct snd_card *card; | ||
308 | if (snd_card_create(idx, id, module, extra_size, &card) < 0) | ||
309 | return NULL; | ||
310 | return card; | ||
311 | } | ||
312 | |||
301 | int snd_card_disconnect(struct snd_card *card); | 313 | int snd_card_disconnect(struct snd_card *card); |
302 | int snd_card_free(struct snd_card *card); | 314 | int snd_card_free(struct snd_card *card); |
303 | int snd_card_free_when_closed(struct snd_card *card); | 315 | int snd_card_free_when_closed(struct snd_card *card); |