[ALSA] dynamic minors (1/6): store device type in struct snd_minor
Instead of a comment string, store the device type in the snd_minor structure. This makes snd_minor more flexible, and has the nice side effect that we don't need anymore to create a separate snd_minor template for registering a device but can pass the file_operations directly to snd_register_device(). Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
This commit is contained in:
committed by
Jaroslav Kysela
parent
a106cd3d9e
commit
2af677fc88
@@ -2444,18 +2444,12 @@ static struct file_operations snd_pcm_oss_f_reg =
|
||||
.mmap = snd_pcm_oss_mmap,
|
||||
};
|
||||
|
||||
static struct snd_minor snd_pcm_oss_reg =
|
||||
{
|
||||
.comment = "digital audio",
|
||||
.f_ops = &snd_pcm_oss_f_reg,
|
||||
};
|
||||
|
||||
static void register_oss_dsp(struct snd_pcm *pcm, int index)
|
||||
{
|
||||
char name[128];
|
||||
sprintf(name, "dsp%i%i", pcm->card->number, pcm->device);
|
||||
if (snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_PCM,
|
||||
pcm->card, index, &snd_pcm_oss_reg,
|
||||
pcm->card, index, &snd_pcm_oss_f_reg,
|
||||
name) < 0) {
|
||||
snd_printk(KERN_ERR "unable to register OSS PCM device %i:%i\n",
|
||||
pcm->card->number, pcm->device);
|
||||
|
Reference in New Issue
Block a user