aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-02-12 07:43:22 -0500
committerTakashi Iwai <tiwai@suse.de>2015-02-12 08:15:54 -0500
commit056622053b8ae02978678ac1321b5bd956e7c812 (patch)
treee2c0602b6efd90dc7d6e760bd7cd4ab0567104ee /sound/isa
parentaf03c243a1f014145dae34368fe975b2f08ed964 (diff)
ALSA: seq: Define driver object in each driver
This patch moves the driver object initialization and allocation to each driver's module init/exit code like other normal drivers. The snd_seq_driver struct is now published in seq_device.h, and each driver is responsible to define it with proper driver attributes (name, probe and remove) with snd_seq_driver specific attributes as id and argsize fields. The helper functions snd_seq_driver_register(), snd_seq_driver_unregister() and module_snd_seq_driver() are used for simplifying codes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/isa')
-rw-r--r--sound/isa/sb/emu8000_synth.c35
1 files changed, 15 insertions, 20 deletions
diff --git a/sound/isa/sb/emu8000_synth.c b/sound/isa/sb/emu8000_synth.c
index 72332dfada9a..4aa719cad331 100644
--- a/sound/isa/sb/emu8000_synth.c
+++ b/sound/isa/sb/emu8000_synth.c
@@ -34,8 +34,9 @@ MODULE_LICENSE("GPL");
34/* 34/*
35 * create a new hardware dependent device for Emu8000 35 * create a new hardware dependent device for Emu8000
36 */ 36 */
37static int snd_emu8000_new_device(struct snd_seq_device *dev) 37static int snd_emu8000_probe(struct device *_dev)
38{ 38{
39 struct snd_seq_device *dev = to_seq_dev(_dev);
39 struct snd_emu8000 *hw; 40 struct snd_emu8000 *hw;
40 struct snd_emux *emu; 41 struct snd_emux *emu;
41 42
@@ -93,8 +94,9 @@ static int snd_emu8000_new_device(struct snd_seq_device *dev)
93/* 94/*
94 * free all resources 95 * free all resources
95 */ 96 */
96static int snd_emu8000_delete_device(struct snd_seq_device *dev) 97static int snd_emu8000_remove(struct device *_dev)
97{ 98{
99 struct snd_seq_device *dev = to_seq_dev(_dev);
98 struct snd_emu8000 *hw; 100 struct snd_emu8000 *hw;
99 101
100 if (dev->driver_data == NULL) 102 if (dev->driver_data == NULL)
@@ -114,21 +116,14 @@ static int snd_emu8000_delete_device(struct snd_seq_device *dev)
114 * INIT part 116 * INIT part
115 */ 117 */
116 118
117static int __init alsa_emu8000_init(void) 119static struct snd_seq_driver emu8000_driver = {
118{ 120 .driver = {
119 121 .name = KBUILD_MODNAME,
120 static struct snd_seq_dev_ops ops = { 122 .probe = snd_emu8000_probe,
121 snd_emu8000_new_device, 123 .remove = snd_emu8000_remove,
122 snd_emu8000_delete_device, 124 },
123 }; 125 .id = SNDRV_SEQ_DEV_ID_EMU8000,
124 return snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_EMU8000, &ops, 126 .argsize = sizeof(struct snd_emu8000 *),
125 sizeof(struct snd_emu8000*)); 127};
126} 128
127 129module_snd_seq_driver(emu8000_driver);
128static void __exit alsa_emu8000_exit(void)
129{
130 snd_seq_device_unregister_driver(SNDRV_SEQ_DEV_ID_EMU8000);
131}
132
133module_init(alsa_emu8000_init)
134module_exit(alsa_emu8000_exit)