virmidi.c (0a1340c185734a57fbf4775927966ad4a1347b02) virmidi.c (788c6043335590e0a483fdc18f85b1405a157bf9)
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

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

80struct snd_card_virmidi {
81 struct snd_card *card;
82 struct snd_rawmidi *midi[MAX_MIDI_DEVICES];
83};
84
85static struct platform_device *devices[SNDRV_CARDS];
86
87
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

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

80struct snd_card_virmidi {
81 struct snd_card *card;
82 struct snd_rawmidi *midi[MAX_MIDI_DEVICES];
83};
84
85static struct platform_device *devices[SNDRV_CARDS];
86
87
88static int __init snd_virmidi_probe(struct platform_device *devptr)
88static int __devinit snd_virmidi_probe(struct platform_device *devptr)
89{
90 struct snd_card *card;
91 struct snd_card_virmidi *vmidi;
92 int idx, err;
93 int dev = devptr->id;
94
95 card = snd_card_new(index[dev], id[dev], THIS_MODULE,
96 sizeof(struct snd_card_virmidi));

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

124 platform_set_drvdata(devptr, card);
125 return 0;
126 }
127 __nodev:
128 snd_card_free(card);
129 return err;
130}
131
89{
90 struct snd_card *card;
91 struct snd_card_virmidi *vmidi;
92 int idx, err;
93 int dev = devptr->id;
94
95 card = snd_card_new(index[dev], id[dev], THIS_MODULE,
96 sizeof(struct snd_card_virmidi));

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

124 platform_set_drvdata(devptr, card);
125 return 0;
126 }
127 __nodev:
128 snd_card_free(card);
129 return err;
130}
131
132static int snd_virmidi_remove(struct platform_device *devptr)
132static int __devexit snd_virmidi_remove(struct platform_device *devptr)
133{
134 snd_card_free(platform_get_drvdata(devptr));
135 platform_set_drvdata(devptr, NULL);
136 return 0;
137}
138
139#define SND_VIRMIDI_DRIVER "snd_virmidi"
140
141static struct platform_driver snd_virmidi_driver = {
142 .probe = snd_virmidi_probe,
133{
134 snd_card_free(platform_get_drvdata(devptr));
135 platform_set_drvdata(devptr, NULL);
136 return 0;
137}
138
139#define SND_VIRMIDI_DRIVER "snd_virmidi"
140
141static struct platform_driver snd_virmidi_driver = {
142 .probe = snd_virmidi_probe,
143 .remove = snd_virmidi_remove,
143 .remove = __devexit_p(snd_virmidi_remove),
144 .driver = {
145 .name = SND_VIRMIDI_DRIVER
146 },
147};
148
149static void __init_or_module snd_virmidi_unregister_all(void)
150{
151 int i;

--- 46 unchanged lines hidden ---
144 .driver = {
145 .name = SND_VIRMIDI_DRIVER
146 },
147};
148
149static void __init_or_module snd_virmidi_unregister_all(void)
150{
151 int i;

--- 46 unchanged lines hidden ---