*参照元 [#ideafde8] #backlinks *説明 [#r101b41a] -パス: [[linux-2.6.33/sound/core/pcm.c]] -FIXME: これは何? --説明 **引数 [#kf1d8e82] -struct device *dev -- --[[linux-2.6.33/device]] -struct device_attribute *attr -- --[[linux-2.6.33/device_attribute]] -char *buf -- **返り値 [#caf227fd] -ssize_t -- **参考 [#odbe7774] *実装 [#k25cc0a3] static ssize_t show_pcm_class(struct device *dev, struct device_attribute *attr, char *buf) { struct snd_pcm *pcm; const char *str; static const char *strs[SNDRV_PCM_CLASS_LAST + 1] = { [SNDRV_PCM_CLASS_GENERIC] = "generic", [SNDRV_PCM_CLASS_MULTI] = "multi", [SNDRV_PCM_CLASS_MODEM] = "modem", [SNDRV_PCM_CLASS_DIGITIZER] = "digitizer", }; - --[[linux-2.6.33/snd_pcm]] - --[[linux-2.6.33/SNDRV_PCM_CLASS_GENERIC]] - --[[linux-2.6.33/SNDRV_PCM_CLASS_MULTI]] - --[[linux-2.6.33/SNDRV_PCM_CLASS_MODEM]] - --[[linux-2.6.33/SNDRV_PCM_CLASS_DIGITIZER]] if (! (pcm = dev_get_drvdata(dev)) || pcm->dev_class > SNDRV_PCM_CLASS_LAST) str = "none"; else str = strs[pcm->dev_class]; - --[[linux-2.6.33/dev_get_drvdata()]] return snprintf(buf, PAGE_SIZE, "%s\n", str); } *コメント [#z6edad26]