virmidi.c (6bd0dd5f0ec67f654ebf95be8ef414afae1eecb7) virmidi.c (45203832df2fa9e94ca0a249ddb20d2b077e58cc)
1/*
2 * Dummy soundcard for virtual rawmidi devices
3 *
4 * Copyright (c) 2000 by Takashi Iwai <tiwai@suse.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 76 unchanged lines hidden (view full) ---

85
86static int __devinit snd_virmidi_probe(struct platform_device *devptr)
87{
88 struct snd_card *card;
89 struct snd_card_virmidi *vmidi;
90 int idx, err;
91 int dev = devptr->id;
92
1/*
2 * Dummy soundcard for virtual rawmidi devices
3 *
4 * Copyright (c) 2000 by Takashi Iwai <tiwai@suse.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 76 unchanged lines hidden (view full) ---

85
86static int __devinit snd_virmidi_probe(struct platform_device *devptr)
87{
88 struct snd_card *card;
89 struct snd_card_virmidi *vmidi;
90 int idx, err;
91 int dev = devptr->id;
92
93 err = snd_card_create(index[dev], id[dev], THIS_MODULE,
94 sizeof(struct snd_card_virmidi), &card);
95 if (err < 0)
96 return err;
93 card = snd_card_new(index[dev], id[dev], THIS_MODULE,
94 sizeof(struct snd_card_virmidi));
95 if (card == NULL)
96 return -ENOMEM;
97 vmidi = (struct snd_card_virmidi *)card->private_data;
98 vmidi->card = card;
99
100 if (midi_devs[dev] > MAX_MIDI_DEVICES) {
97 vmidi = (struct snd_card_virmidi *)card->private_data;
98 vmidi->card = card;
99
100 if (midi_devs[dev] > MAX_MIDI_DEVICES) {
101 snd_printk("too much midi devices for virmidi %d: force to use %d\n", dev, MAX_MIDI_DEVICES);
101 snd_printk(KERN_WARNING
102 "too much midi devices for virmidi %d: "
103 "force to use %d\n", dev, MAX_MIDI_DEVICES);
102 midi_devs[dev] = MAX_MIDI_DEVICES;
103 }
104 for (idx = 0; idx < midi_devs[dev]; idx++) {
105 struct snd_rawmidi *rmidi;
106 struct snd_virmidi_dev *rdev;
107 if ((err = snd_virmidi_new(card, idx, &rmidi)) < 0)
108 goto __nodev;
109 rdev = rmidi->private_data;

--- 86 unchanged lines hidden ---
104 midi_devs[dev] = MAX_MIDI_DEVICES;
105 }
106 for (idx = 0; idx < midi_devs[dev]; idx++) {
107 struct snd_rawmidi *rmidi;
108 struct snd_virmidi_dev *rdev;
109 if ((err = snd_virmidi_new(card, idx, &rmidi)) < 0)
110 goto __nodev;
111 rdev = rmidi->private_data;

--- 86 unchanged lines hidden ---