*参照元 [#q9252f2c] #backlinks *説明 [#rd37c51f] -パス: [[linux-2.6.33/sound/core/init.c]] -FIXME: これは何? --説明 **引数 [#w1752dd2] -struct snd_card *card -- --[[linux-2.6.33/snd_card]] **返り値 [#p46fa8e7] -int -- **参考 [#zbebed37] *実装 [#w4251c82] /** * snd_card_register - register the soundcard * @card: soundcard structure * * This function registers all the devices assigned to the soundcard. * Until calling this, the ALSA control interface is blocked from the * external accesses. Thus, you should call this function at the end * of the initialization of the card. * * Returns zero otherwise a negative error code if the registrain failed. */ int snd_card_register(struct snd_card *card) { int err; if (snd_BUG_ON(!card)) return -EINVAL; - --[[linux-2.6.33/snd_BUG_ON()]] #ifndef CONFIG_SYSFS_DEPRECATED - --[[linux-2.6.33/CONFIG_SYSFS_DEPRECATED]] if (!card->card_dev) { card->card_dev = device_create(sound_class, card->dev, MKDEV(0, 0), card, "card%i", card->number); if (IS_ERR(card->card_dev)) card->card_dev = NULL; } - --[[linux-2.6.33/device_create()]] - --[[linux-2.6.33/sound_class(global)]] - --[[linux-2.6.33/IS_ERR()]] #endif if ((err = snd_device_register_all(card)) < 0) return err; - --[[linux-2.6.33/snd_device_register_all()]] mutex_lock(&snd_card_mutex); if (snd_cards[card->number]) { /* already registered */ mutex_unlock(&snd_card_mutex); return 0; } - --[[linux-2.6.33/mutex_lock()]] - --[[linux-2.6.33/mutex_unlock()]] - --[[linux-2.6.33/snd_card_mutex(global)]] snd_card_set_id_no_lock(card, card->id[0] == '\0' ? NULL : card->id); snd_cards[card->number] = card; mutex_unlock(&snd_card_mutex); init_info_for_card(card); - --[[linux-2.6.33/init_info_for_card()]] #if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) - --[[linux-2.6.33/CONFIG_SND_MIXER_OSS]] - --[[linux-2.6.33/CONFIG_SND_MIXER_OSS_MODULE]] if (snd_mixer_oss_notify_callback) snd_mixer_oss_notify_callback(card, SND_MIXER_OSS_NOTIFY_REGISTER); - --[[linux-2.6.33/snd_mixer_oss_notify_callback(global)]] #endif #ifndef CONFIG_SYSFS_DEPRECATED if (card->card_dev) { err = device_create_file(card->card_dev, &card_id_attrs); if (err < 0) return err; err = device_create_file(card->card_dev, &card_number_attrs); if (err < 0) return err; } - --[[linux-2.6.33/device_create_file()]] - --[[linux-2.6.33/card_id_attrs(global)]] - --[[linux-2.6.33/card_number_attrs(global)]] #endif return 0; } EXPORT_SYMBOL(snd_card_register); -ライセンスに関係なくシンボルを公開する。 --[[linux-2.6.33/EXPORT_SYMBOL()]] *コメント [#o9a44722]