*参照元 [#re37c5f2] #backlinks *説明 [#bcf14fca] -パス: [[linux-2.6.33/sound/core/sound.c]] -FIXME: これは何? --説明 **引数 [#bfb17214] -struct inode *inode -- --[[linux-2.6.33/inode]] -struct file *file -- --[[linux-2.6.33/file]] **返り値 [#wa4407be] -int -- **参考 [#d21ce9c2] *実装 [#l1648be2] static int __snd_open(struct inode *inode, struct file *file) { unsigned int minor = iminor(inode); struct snd_minor *mptr = NULL; const struct file_operations *old_fops; int err = 0; - --[[linux-2.6.33/snd_minor]] - --[[linux-2.6.33/iminor()]] - --[[linux-2.6.33/file_operations]] if (minor >= ARRAY_SIZE(snd_minors)) return -ENODEV; - --[[linux-2.6.33/ARRAY_SIZE()]] - --[[linux-2.6.33/snd_minors(global)]] mptr = snd_minors[minor]; if (mptr == NULL) { #ifdef CONFIG_MODULES - --[[linux-2.6.33/CONFIG_MODULES]] int dev = SNDRV_MINOR_DEVICE(minor); - --[[linux-2.6.33/SNDRV_MINOR_DEVICE()]] if (dev == SNDRV_MINOR_CONTROL) { - --[[linux-2.6.33/SNDRV_MINOR_CONTROL]] /* /dev/aloadC? */ int card = SNDRV_MINOR_CARD(minor); if (snd_cards[card] == NULL) snd_request_card(card); - --[[linux-2.6.33/SNDRV_MINOR_CARD()]] - --[[linux-2.6.33/snd_request_card()]] } else if (dev == SNDRV_MINOR_GLOBAL) { - --[[linux-2.6.33/SNDRV_MINOR_GLOBAL]] /* /dev/aloadSEQ */ snd_request_other(minor); - --[[linux-2.6.33/snd_request_other()]] } #ifndef CONFIG_SND_DYNAMIC_MINORS - --[[linux-2.6.33/CONFIG_SND_DYNAMIC_MINORS]] /* /dev/snd/{controlC?,seq} */ mptr = snd_minors[minor]; if (mptr == NULL) #endif #endif return -ENODEV; } old_fops = file->f_op; file->f_op = fops_get(mptr->f_ops); if (file->f_op == NULL) { file->f_op = old_fops; return -ENODEV; } - --[[linux-2.6.33/fops_get()]] if (file->f_op->open) err = file->f_op->open(inode, file); if (err) { fops_put(file->f_op); file->f_op = fops_get(old_fops); } fops_put(old_fops); - --[[linux-2.6.33/fops_put()]] return err; } *コメント [#d7fabc14]