Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
[firefly-linux-kernel-4.4.55.git] / sound / core / seq / seq_midi.c
index 68fec776da2619db52163b143551b6e045ce2ee8..5dd0ee2583592e156f5822c2aa56e83c4c41c97d 100644 (file)
@@ -273,8 +273,9 @@ static void snd_seq_midisynth_delete(struct seq_midisynth *msynth)
 
 /* register new midi synth port */
 static int
-snd_seq_midisynth_register_port(struct snd_seq_device *dev)
+snd_seq_midisynth_probe(struct device *_dev)
 {
+       struct snd_seq_device *dev = to_seq_dev(_dev);
        struct seq_midisynth_client *client;
        struct seq_midisynth *msynth, *ms;
        struct snd_seq_port_info *port;
@@ -427,8 +428,9 @@ snd_seq_midisynth_register_port(struct snd_seq_device *dev)
 
 /* release midi synth port */
 static int
-snd_seq_midisynth_unregister_port(struct snd_seq_device *dev)
+snd_seq_midisynth_remove(struct device *_dev)
 {
+       struct snd_seq_device *dev = to_seq_dev(_dev);
        struct seq_midisynth_client *client;
        struct seq_midisynth *msynth;
        struct snd_card *card = dev->card;
@@ -457,24 +459,14 @@ snd_seq_midisynth_unregister_port(struct snd_seq_device *dev)
        return 0;
 }
 
+static struct snd_seq_driver seq_midisynth_driver = {
+       .driver = {
+               .name = KBUILD_MODNAME,
+               .probe = snd_seq_midisynth_probe,
+               .remove = snd_seq_midisynth_remove,
+       },
+       .id = SNDRV_SEQ_DEV_ID_MIDISYNTH,
+       .argsize = 0,
+};
 
-static int __init alsa_seq_midi_init(void)
-{
-       static struct snd_seq_dev_ops ops = {
-               snd_seq_midisynth_register_port,
-               snd_seq_midisynth_unregister_port,
-       };
-       memset(&synths, 0, sizeof(synths));
-       snd_seq_autoload_lock();
-       snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_MIDISYNTH, &ops, 0);
-       snd_seq_autoload_unlock();
-       return 0;
-}
-
-static void __exit alsa_seq_midi_exit(void)
-{
-       snd_seq_device_unregister_driver(SNDRV_SEQ_DEV_ID_MIDISYNTH);
-}
-
-module_init(alsa_seq_midi_init)
-module_exit(alsa_seq_midi_exit)
+module_snd_seq_driver(seq_midisynth_driver);