]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - sound/pci/emu10k1/emu10k1_synth.c
Merge tag 'omap-for-v4.6/dt-ti81xx-signed' of git://git.kernel.org/pub/scm/linux...
[karo-tx-linux.git] / sound / pci / emu10k1 / emu10k1_synth.c
index 4c41c903a840b5a6d3f802970b6ced5246b54462..5457d5613f6b46ac79b342282f3380b376f15a28 100644 (file)
@@ -29,8 +29,9 @@ MODULE_LICENSE("GPL");
 /*
  * create a new hardware dependent device for Emu10k1
  */
-static int snd_emu10k1_synth_new_device(struct snd_seq_device *dev)
+static int snd_emu10k1_synth_probe(struct device *_dev)
 {
+       struct snd_seq_device *dev = to_seq_dev(_dev);
        struct snd_emux *emux;
        struct snd_emu10k1 *hw;
        struct snd_emu10k1_synth_arg *arg;
@@ -79,8 +80,9 @@ static int snd_emu10k1_synth_new_device(struct snd_seq_device *dev)
        return 0;
 }
 
-static int snd_emu10k1_synth_delete_device(struct snd_seq_device *dev)
+static int snd_emu10k1_synth_remove(struct device *_dev)
 {
+       struct snd_seq_device *dev = to_seq_dev(_dev);
        struct snd_emux *emux;
        struct snd_emu10k1 *hw;
        unsigned long flags;
@@ -104,21 +106,14 @@ static int snd_emu10k1_synth_delete_device(struct snd_seq_device *dev)
  *  INIT part
  */
 
-static int __init alsa_emu10k1_synth_init(void)
-{
-       
-       static struct snd_seq_dev_ops ops = {
-               snd_emu10k1_synth_new_device,
-               snd_emu10k1_synth_delete_device,
-       };
-       return snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH, &ops,
-                                             sizeof(struct snd_emu10k1_synth_arg));
-}
-
-static void __exit alsa_emu10k1_synth_exit(void)
-{
-       snd_seq_device_unregister_driver(SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH);
-}
-
-module_init(alsa_emu10k1_synth_init)
-module_exit(alsa_emu10k1_synth_exit)
+static struct snd_seq_driver emu10k1_synth_driver = {
+       .driver = {
+               .name = KBUILD_MODNAME,
+               .probe = snd_emu10k1_synth_probe,
+               .remove = snd_emu10k1_synth_remove,
+       },
+       .id = SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH,
+       .argsize = sizeof(struct snd_emu10k1_synth_arg),
+};
+
+module_snd_seq_driver(emu10k1_synth_driver);