]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[ALSA] dynamic minors (1/6): store device type in struct snd_minor
authorClemens Ladisch <clemens@ladisch.de>
Sun, 20 Nov 2005 13:03:48 +0000 (14:03 +0100)
committerJaroslav Kysela <perex@suse.cz>
Tue, 3 Jan 2006 11:29:14 +0000 (12:29 +0100)
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>
14 files changed:
include/sound/core.h
include/sound/pcm.h
sound/core/control.c
sound/core/hwdep.c
sound/core/oss/mixer_oss.c
sound/core/oss/pcm_oss.c
sound/core/pcm.c
sound/core/pcm_native.c
sound/core/rawmidi.c
sound/core/seq/oss/seq_oss.c
sound/core/seq/seq_clientmgr.c
sound/core/sound.c
sound/core/sound_oss.c
sound/core/timer.c

index f00b9c9b567f05e80b10a6585a18c49bf32821e0..f557c8ac450e901c286c2d93335f86a7882354a4 100644 (file)
@@ -185,8 +185,8 @@ static inline int snd_power_wait(struct snd_card *card, unsigned int state, stru
 struct snd_minor {
        struct list_head list;          /* list of all minors per card */
        int number;                     /* minor number */
+       int type;                       /* SNDRV_DEVICE_TYPE_XXX */
        int device;                     /* device number */
-       const char *comment;            /* for /proc/asound/devices */
        struct file_operations *f_ops;  /* file operations */
        char name[0];                   /* device name (keep at the end of
                                                                structure) */
@@ -199,11 +199,13 @@ extern int snd_ecards_limit;
 
 void snd_request_card(int card);
 
-int snd_register_device(int type, struct snd_card *card, int dev, struct snd_minor *reg, const char *name);
+int snd_register_device(int type, struct snd_card *card, int dev,
+                       struct file_operations *f_ops, const char *name);
 int snd_unregister_device(int type, struct snd_card *card, int dev);
 
 #ifdef CONFIG_SND_OSSEMUL
-int snd_register_oss_device(int type, struct snd_card *card, int dev, struct snd_minor *reg, const char *name);
+int snd_register_oss_device(int type, struct snd_card *card, int dev,
+                           struct file_operations *f_ops, const char *name);
 int snd_unregister_oss_device(int type, struct snd_card *card, int dev);
 #endif
 
index 7e77c0add80a573113775091eb6a986fcbba6f1c..5e29b0e0f2148c22dadecb1dd75fcad817941ffc 100644 (file)
@@ -402,7 +402,6 @@ struct snd_pcm_str {
        struct snd_pcm_oss_stream oss;
 #endif
        struct snd_pcm_file *files;
-       struct snd_minor *reg;
        struct snd_info_entry *proc_root;
        struct snd_info_entry *proc_info_entry;
 #ifdef CONFIG_SND_DEBUG
@@ -441,7 +440,7 @@ struct snd_pcm_notify {
  */
 
 extern struct snd_pcm *snd_pcm_devices[];
-extern struct snd_minor snd_pcm_reg[2];
+extern struct file_operations snd_pcm_f_ops[2];
 
 int snd_pcm_new(struct snd_card *card, char *id, int device,
                int playback_count, int capture_count,
index f8f98cc524176be00462616b2f6d11605cc15977..23561e74712be219f8051b5fc2ce4829ed7dfaef 100644 (file)
@@ -1264,12 +1264,6 @@ static struct file_operations snd_ctl_f_ops =
        .fasync =       snd_ctl_fasync,
 };
 
-static struct snd_minor snd_ctl_reg =
-{
-       .comment =      "ctl",
-       .f_ops =        &snd_ctl_f_ops,
-};
-
 /*
  * registration of the control device
  */
@@ -1284,7 +1278,7 @@ static int snd_ctl_dev_register(struct snd_device *device)
        snd_assert(cardnum >= 0 && cardnum < SNDRV_CARDS, return -ENXIO);
        sprintf(name, "controlC%i", cardnum);
        if ((err = snd_register_device(SNDRV_DEVICE_TYPE_CONTROL,
-                                       card, 0, &snd_ctl_reg, name)) < 0)
+                                      card, -1, &snd_ctl_f_ops, name)) < 0)
                return err;
        return 0;
 }
@@ -1336,7 +1330,8 @@ static int snd_ctl_dev_unregister(struct snd_device *device)
        snd_assert(card != NULL, return -ENXIO);
        cardnum = card->number;
        snd_assert(cardnum >= 0 && cardnum < SNDRV_CARDS, return -ENXIO);
-       if ((err = snd_unregister_device(SNDRV_DEVICE_TYPE_CONTROL, card, 0)) < 0)
+       if ((err = snd_unregister_device(SNDRV_DEVICE_TYPE_CONTROL,
+                                        card, -1)) < 0)
                return err;
        return snd_ctl_dev_free(device);
 }
index 444e266e7c48b97b92fe74d161723630178b4c6e..27d5bf7266f0e868af1fb7e42ce38699b0ec0cc0 100644 (file)
@@ -330,12 +330,6 @@ static struct file_operations snd_hwdep_f_ops =
        .mmap =         snd_hwdep_mmap,
 };
 
-static struct snd_minor snd_hwdep_reg =
-{
-       .comment =      "hardware dependent",
-       .f_ops =        &snd_hwdep_f_ops,
-};
-
 /**
  * snd_hwdep_new - create a new hwdep instance
  * @card: the card instance
@@ -416,7 +410,7 @@ static int snd_hwdep_dev_register(struct snd_device *device)
        sprintf(name, "hwC%iD%i", hwdep->card->number, hwdep->device);
        if ((err = snd_register_device(SNDRV_DEVICE_TYPE_HWDEP,
                                       hwdep->card, hwdep->device,
-                                      &snd_hwdep_reg, name)) < 0) {
+                                      &snd_hwdep_f_ops, name)) < 0) {
                snd_printk(KERN_ERR "unable to register hardware dependent device %i:%i\n",
                           hwdep->card->number, hwdep->device);
                snd_hwdep_devices[idx] = NULL;
@@ -431,7 +425,8 @@ static int snd_hwdep_dev_register(struct snd_device *device)
                } else {
                        if (snd_register_oss_device(hwdep->oss_type,
                                                    hwdep->card, hwdep->device,
-                                                   &snd_hwdep_reg, hwdep->oss_dev) < 0) {
+                                                   &snd_hwdep_f_ops,
+                                                   hwdep->oss_dev) < 0) {
                                snd_printk(KERN_ERR "unable to register OSS compatibility device %i:%i\n",
                                           hwdep->card->number, hwdep->device);
                        } else
index e448002ca7b93f5bb399ab118e7634952e4d9ec4..2dd6bf9b49ed13c23e419dee1319a28d65ff3012 100644 (file)
@@ -398,12 +398,6 @@ static struct file_operations snd_mixer_oss_f_ops =
        .compat_ioctl = snd_mixer_oss_ioctl_compat,
 };
 
-static struct snd_minor snd_mixer_oss_reg =
-{
-       .comment =      "mixer",
-       .f_ops =        &snd_mixer_oss_f_ops,
-};
-
 /*
  *  utilities
  */
@@ -1292,7 +1286,7 @@ static int snd_mixer_oss_notify_handler(struct snd_card *card, int cmd)
                sprintf(name, "mixer%i%i", card->number, 0);
                if ((err = snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_MIXER,
                                                   card, 0,
-                                                  &snd_mixer_oss_reg,
+                                                  &snd_mixer_oss_f_ops,
                                                   name)) < 0) {
                        snd_printk(KERN_ERR "unable to register OSS mixer device %i:%i\n",
                                   card->number, 0);
index ffc13b9194b7829404c8e86b8480a054fe5a2a83..947bf08df42a35495adb288619631a2091b3cc4f 100644 (file)
@@ -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);
index 9305ac357a3e8c6cce3d09876f02a49bb43d1da5..2bc5f69ec2a850c879d795830e96305516c2d9d3 100644 (file)
@@ -597,7 +597,6 @@ int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count)
        pstr->stream = stream;
        pstr->pcm = pcm;
        pstr->substream_count = substream_count;
-       pstr->reg = &snd_pcm_reg[stream];
        if (substream_count > 0) {
                err = snd_pcm_stream_proc_init(pstr);
                if (err < 0) {
@@ -897,7 +896,10 @@ static int snd_pcm_dev_register(struct snd_device *device)
                        devtype = SNDRV_DEVICE_TYPE_PCM_CAPTURE;
                        break;
                }
-               if ((err = snd_register_device(devtype, pcm->card, pcm->device, pcm->streams[cidx].reg, str)) < 0) {
+               if ((err = snd_register_device(devtype, pcm->card,
+                                              pcm->device,
+                                              &snd_pcm_f_ops[cidx], str)) < 0)
+               {
                        snd_pcm_devices[idx] = NULL;
                        up(&register_mutex);
                        return err;
index 7bac1cbe38da4a122478ace0af3855422f805e83..bb40c016135e598b272e73e24d74bd591c0bb2f8 100644 (file)
@@ -3370,40 +3370,29 @@ out:
  *  Register section
  */
 
-static struct file_operations snd_pcm_f_ops_playback = {
-       .owner =        THIS_MODULE,
-       .write =        snd_pcm_write,
-       .writev =       snd_pcm_writev,
-       .open =         snd_pcm_open,
-       .release =      snd_pcm_release,
-       .poll =         snd_pcm_playback_poll,
-       .unlocked_ioctl =       snd_pcm_playback_ioctl,
-       .compat_ioctl = snd_pcm_ioctl_compat,
-       .mmap =         snd_pcm_mmap,
-       .fasync =       snd_pcm_fasync,
-};
-
-static struct file_operations snd_pcm_f_ops_capture = {
-       .owner =        THIS_MODULE,
-       .read =         snd_pcm_read,
-       .readv =        snd_pcm_readv,
-       .open =         snd_pcm_open,
-       .release =      snd_pcm_release,
-       .poll =         snd_pcm_capture_poll,
-       .unlocked_ioctl =       snd_pcm_capture_ioctl,
-       .compat_ioctl = snd_pcm_ioctl_compat,
-       .mmap =         snd_pcm_mmap,
-       .fasync =       snd_pcm_fasync,
-};
-
-struct snd_minor snd_pcm_reg[2] =
-{
+struct file_operations snd_pcm_f_ops[2] = {
        {
-               .comment =      "digital audio playback",
-               .f_ops =        &snd_pcm_f_ops_playback,
+               .owner =                THIS_MODULE,
+               .write =                snd_pcm_write,
+               .writev =               snd_pcm_writev,
+               .open =                 snd_pcm_open,
+               .release =              snd_pcm_release,
+               .poll =                 snd_pcm_playback_poll,
+               .unlocked_ioctl =       snd_pcm_playback_ioctl,
+               .compat_ioctl =         snd_pcm_ioctl_compat,
+               .mmap =                 snd_pcm_mmap,
+               .fasync =               snd_pcm_fasync,
        },
        {
-               .comment =      "digital audio capture",
-               .f_ops =        &snd_pcm_f_ops_capture,
+               .owner =                THIS_MODULE,
+               .read =                 snd_pcm_read,
+               .readv =                snd_pcm_readv,
+               .open =                 snd_pcm_open,
+               .release =              snd_pcm_release,
+               .poll =                 snd_pcm_capture_poll,
+               .unlocked_ioctl =       snd_pcm_capture_ioctl,
+               .compat_ioctl =         snd_pcm_ioctl_compat,
+               .mmap =                 snd_pcm_mmap,
+               .fasync =               snd_pcm_fasync,
        }
 };
index d703545cae8a9ca004395a6dfb87ecc9ec92b849..7ac77e5ddcb1e8da3ecedd0a0eedd5ebd36b269f 100644 (file)
@@ -1367,12 +1367,6 @@ static struct file_operations snd_rawmidi_f_ops =
        .compat_ioctl = snd_rawmidi_ioctl_compat,
 };
 
-static struct snd_minor snd_rawmidi_reg =
-{
-       .comment =      "raw midi",
-       .f_ops =        &snd_rawmidi_f_ops,
-};
-
 static int snd_rawmidi_alloc_substreams(struct snd_rawmidi *rmidi,
                                        struct snd_rawmidi_str *stream,
                                        int direction,
@@ -1516,7 +1510,7 @@ static int snd_rawmidi_dev_register(struct snd_device *device)
        sprintf(name, "midiC%iD%i", rmidi->card->number, rmidi->device);
        if ((err = snd_register_device(SNDRV_DEVICE_TYPE_RAWMIDI,
                                       rmidi->card, rmidi->device,
-                                      &snd_rawmidi_reg, name)) < 0) {
+                                      &snd_rawmidi_f_ops, name)) < 0) {
                snd_printk(KERN_ERR "unable to register rawmidi device %i:%i\n", rmidi->card->number, rmidi->device);
                snd_rawmidi_devices[idx] = NULL;
                up(&register_mutex);
@@ -1533,7 +1527,8 @@ static int snd_rawmidi_dev_register(struct snd_device *device)
        rmidi->ossreg = 0;
        if ((int)rmidi->device == midi_map[rmidi->card->number]) {
                if (snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_MIDI,
-                                           rmidi->card, 0, &snd_rawmidi_reg, name) < 0) {
+                                           rmidi->card, 0,
+                                           &snd_rawmidi_f_ops, name) < 0) {
                        snd_printk(KERN_ERR "unable to register OSS rawmidi device %i:%i\n", rmidi->card->number, 0);
                } else {
                        rmidi->ossreg++;
@@ -1544,7 +1539,8 @@ static int snd_rawmidi_dev_register(struct snd_device *device)
        }
        if ((int)rmidi->device == amidi_map[rmidi->card->number]) {
                if (snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_MIDI,
-                                           rmidi->card, 1, &snd_rawmidi_reg, name) < 0) {
+                                           rmidi->card, 1,
+                                           &snd_rawmidi_f_ops, name) < 0) {
                        snd_printk(KERN_ERR "unable to register OSS rawmidi device %i:%i\n", rmidi->card->number, 1);
                } else {
                        rmidi->ossreg++;
index 2371e41b13efbbd6d4e101e71108089075782696..61c0a41376fd13d6c0e696bab867fa39974965e7 100644 (file)
@@ -217,11 +217,6 @@ static struct file_operations seq_oss_f_ops =
        .compat_ioctl = odev_ioctl_compat,
 };
 
-static struct snd_minor seq_oss_reg = {
-       .comment =      "sequencer",
-       .f_ops =        &seq_oss_f_ops,
-};
-
 static int __init
 register_device(void)
 {
@@ -230,7 +225,7 @@ register_device(void)
        down(&register_mutex);
        if ((rc = snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_SEQUENCER,
                                          NULL, 0,
-                                         &seq_oss_reg,
+                                         &seq_oss_f_ops,
                                          SNDRV_SEQ_OSS_DEVNAME)) < 0) {
                snd_printk(KERN_ERR "can't register device seq\n");
                up(&register_mutex);
@@ -238,7 +233,7 @@ register_device(void)
        }
        if ((rc = snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_MUSIC,
                                          NULL, 0,
-                                         &seq_oss_reg,
+                                         &seq_oss_f_ops,
                                          SNDRV_SEQ_OSS_DEVNAME)) < 0) {
                snd_printk(KERN_ERR "can't register device music\n");
                snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_SEQUENCER, NULL, 0);
index 5eab4201c6407cc9def0960eef33e78eb209fa64..087fdf32732bf67471b57e41286c477bda33e21d 100644 (file)
@@ -2520,13 +2520,6 @@ static struct file_operations snd_seq_f_ops =
        .compat_ioctl = snd_seq_ioctl_compat,
 };
 
-static struct snd_minor snd_seq_reg =
-{
-       .comment =      "sequencer",
-       .f_ops =        &snd_seq_f_ops,
-};
-
-
 /* 
  * register sequencer device 
  */
@@ -2537,7 +2530,8 @@ int __init snd_sequencer_device_init(void)
        if (down_interruptible(&register_mutex))
                return -ERESTARTSYS;
 
-       if ((err = snd_register_device(SNDRV_DEVICE_TYPE_SEQUENCER, NULL, 0, &snd_seq_reg, "seq")) < 0) {
+       if ((err = snd_register_device(SNDRV_DEVICE_TYPE_SEQUENCER, NULL, 0,
+                                      &snd_seq_f_ops, "seq")) < 0) {
                up(&register_mutex);
                return err;
        }
index fb236a6b9c34f75fabe658321266d5e87acfc51a..798c24c2de20bf5caf1e6b844d3183ec14c4519f 100644 (file)
@@ -195,7 +195,7 @@ static int snd_kernel_minor(int type, struct snd_card *card, int dev)
  * @type: the device type, SNDRV_DEVICE_TYPE_XXX
  * @card: the card instance
  * @dev: the device index
- * @reg: the struct snd_minor record
+ * @f_ops: the file operations
  * @name: the device file name
  *
  * Registers an ALSA device file for the given card.
@@ -203,7 +203,8 @@ static int snd_kernel_minor(int type, struct snd_card *card, int dev)
  *
  * Retrurns zero if successful, or a negative error code on failure.
  */
-int snd_register_device(int type, struct snd_card *card, int dev, struct snd_minor * reg, const char *name)
+int snd_register_device(int type, struct snd_card *card, int dev,
+                       struct file_operations *f_ops, const char *name)
 {
        int minor = snd_kernel_minor(type, card, dev);
        struct snd_minor *preg;
@@ -212,12 +213,13 @@ int snd_register_device(int type, struct snd_card *card, int dev, struct snd_min
        if (minor < 0)
                return minor;
        snd_assert(name, return -EINVAL);
-       preg = kmalloc(sizeof(struct snd_minor) + strlen(name) + 1, GFP_KERNEL);
+       preg = kzalloc(sizeof(struct snd_minor) + strlen(name) + 1, GFP_KERNEL);
        if (preg == NULL)
                return -ENOMEM;
-       *preg = *reg;
        preg->number = minor;
+       preg->type = type;
        preg->device = dev;
+       preg->f_ops = f_ops;
        strcpy(preg->name, name);
        down(&sound_mutex);
        if (snd_minor_search(minor)) {
@@ -276,6 +278,28 @@ int snd_unregister_device(int type, struct snd_card *card, int dev)
 
 static struct snd_info_entry *snd_minor_info_entry = NULL;
 
+static const char *snd_device_type_name(int type)
+{
+       switch (type) {
+       case SNDRV_DEVICE_TYPE_CONTROL:
+               return "control";
+       case SNDRV_DEVICE_TYPE_HWDEP:
+               return "hardware dependent";
+       case SNDRV_DEVICE_TYPE_RAWMIDI:
+               return "raw midi";
+       case SNDRV_DEVICE_TYPE_PCM_PLAYBACK:
+               return "digital audio playback";
+       case SNDRV_DEVICE_TYPE_PCM_CAPTURE:
+               return "digital audio capture";
+       case SNDRV_DEVICE_TYPE_SEQUENCER:
+               return "sequencer";
+       case SNDRV_DEVICE_TYPE_TIMER:
+               return "timer";
+       default:
+               return "?";
+       }
+}
+
 static void snd_minor_info_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
 {
        int card, device;
@@ -288,11 +312,11 @@ static void snd_minor_info_read(struct snd_info_entry *entry, struct snd_info_bu
                        mptr = list_entry(list, struct snd_minor, list);
                        if (SNDRV_MINOR_DEVICE(mptr->number) != SNDRV_MINOR_GLOBAL) {
                                if ((device = mptr->device) >= 0)
-                                       snd_iprintf(buffer, "%3i: [%i-%2i]: %s\n", mptr->number, card, device, mptr->comment);
+                                       snd_iprintf(buffer, "%3i: [%i-%2i]: %s\n", mptr->number, card, device, snd_device_type_name(mptr->type));
                                else
-                                       snd_iprintf(buffer, "%3i: [%i]   : %s\n", mptr->number, card, mptr->comment);
+                                       snd_iprintf(buffer, "%3i: [%i]   : %s\n", mptr->number, card, snd_device_type_name(mptr->type));
                        } else {
-                               snd_iprintf(buffer, "%3i:       : %s\n", mptr->number, mptr->comment);
+                               snd_iprintf(buffer, "%3i:       : %s\n", mptr->number, snd_device_type_name(mptr->type));
                        }
                }
        }
index ec37604ffb68c9cfb5f9d8d7c14635830540d2c6..4d189ffaa764302f72225ecb908994a96f93d16b 100644 (file)
@@ -91,7 +91,7 @@ static int snd_oss_kernel_minor(int type, struct snd_card *card, int dev)
 }
 
 int snd_register_oss_device(int type, struct snd_card *card, int dev,
-                           struct snd_minor * reg, const char *name)
+                           struct file_operations *f_ops, const char *name)
 {
        int minor = snd_oss_kernel_minor(type, card, dev);
        int minor_unit;
@@ -103,12 +103,13 @@ int snd_register_oss_device(int type, struct snd_card *card, int dev,
 
        if (minor < 0)
                return minor;
-       preg = (struct snd_minor *)kmalloc(sizeof(struct snd_minor), GFP_KERNEL);
+       preg = kzalloc(sizeof(struct snd_minor), GFP_KERNEL);
        if (preg == NULL)
                return -ENOMEM;
-       *preg = *reg;
        preg->number = minor;
+       preg->type = type;
        preg->device = dev;
+       preg->f_ops = f_ops;
        down(&sound_oss_mutex);
        list_add_tail(&preg->list, &snd_oss_minors_hash[cidx]);
        minor_unit = SNDRV_MINOR_OSS_DEVICE(minor);
@@ -125,11 +126,12 @@ int snd_register_oss_device(int type, struct snd_card *card, int dev,
        }
        if (card)
                carddev = card->dev;
-       register1 = register_sound_special_device(reg->f_ops, minor, carddev);
+       register1 = register_sound_special_device(f_ops, minor, carddev);
        if (register1 != minor)
                goto __end;
        if (track2 >= 0) {
-               register2 = register_sound_special_device(reg->f_ops, track2, carddev);
+               register2 = register_sound_special_device(f_ops, track2,
+                                                         carddev);
                if (register2 != track2)
                        goto __end;
        }
@@ -190,6 +192,25 @@ int snd_unregister_oss_device(int type, struct snd_card *card, int dev)
 
 static struct snd_info_entry *snd_minor_info_oss_entry = NULL;
 
+static const char *snd_oss_device_type_name(int type)
+{
+       switch (type) {
+       case SNDRV_OSS_DEVICE_TYPE_MIXER:
+               return "mixer";
+       case SNDRV_OSS_DEVICE_TYPE_SEQUENCER:
+       case SNDRV_OSS_DEVICE_TYPE_MUSIC:
+               return "sequencer";
+       case SNDRV_OSS_DEVICE_TYPE_PCM:
+               return "digital audio";
+       case SNDRV_OSS_DEVICE_TYPE_MIDI:
+               return "raw midi";
+       case SNDRV_OSS_DEVICE_TYPE_DMFM:
+               return "hardware dependent";
+       default:
+               return "?";
+       }
+}
+
 static void snd_minor_info_oss_read(struct snd_info_entry *entry,
                                    struct snd_info_buffer *buffer)
 {
@@ -205,9 +226,9 @@ static void snd_minor_info_oss_read(struct snd_info_entry *entry,
                        if (dev != SNDRV_MINOR_OSS_SNDSTAT &&
                            dev != SNDRV_MINOR_OSS_SEQUENCER &&
                            dev != SNDRV_MINOR_OSS_MUSIC)
-                               snd_iprintf(buffer, "%3i: [%i-%2i]: %s\n", mptr->number, card, dev, mptr->comment);
+                               snd_iprintf(buffer, "%3i: [%i-%2i]: %s\n", mptr->number, card, dev, snd_oss_device_type_name(mptr->type));
                        else
-                               snd_iprintf(buffer, "%3i:       : %s\n", mptr->number, mptr->comment);
+                               snd_iprintf(buffer, "%3i:       : %s\n", mptr->number, snd_oss_device_type_name(mptr->type));
                }
        }
        up(&sound_oss_mutex);
index 6aad411dd7b8d49afe6e51bfc5e6986330bbf349..a7bcb04263cba2fd3c79d1dc5dc47b215205b72c 100644 (file)
@@ -1924,12 +1924,6 @@ static struct file_operations snd_timer_f_ops =
        .fasync =       snd_timer_user_fasync,
 };
 
-static struct snd_minor snd_timer_reg =
-{
-       .comment =      "timer",
-       .f_ops =        &snd_timer_f_ops,
-};
-
 /*
  *  ENTRY functions
  */
@@ -1959,7 +1953,7 @@ static int __init alsa_timer_init(void)
                snd_printk(KERN_ERR "unable to register system timer (%i)\n",
                           err);
        if ((err = snd_register_device(SNDRV_DEVICE_TYPE_TIMER,
-                                       NULL, 0, &snd_timer_reg, "timer"))<0)
+                                      NULL, 0, &snd_timer_f_ops, "timer")) < 0)
                snd_printk(KERN_ERR "unable to register timer device (%i)\n",
                           err);
        return 0;