sound: Add module.h to the previously silent sound users
[pandora-kernel.git] / sound / core / seq / seq_virmidi.c
index 0cfa06c..4b50e60 100644 (file)
  *
  */
 
-#include <sound/driver.h>
 #include <linux/init.h>
 #include <linux/wait.h>
-#include <linux/sched.h>
+#include <linux/module.h>
 #include <linux/slab.h>
 #include <sound/core.h>
 #include <sound/rawmidi.h>
@@ -81,13 +80,11 @@ static int snd_virmidi_dev_receive_event(struct snd_virmidi_dev *rdev,
                                         struct snd_seq_event *ev)
 {
        struct snd_virmidi *vmidi;
-       struct list_head *list;
        unsigned char msg[4];
        int len;
 
        read_lock(&rdev->filelist_lock);
-       list_for_each(list, &rdev->filelist) {
-               vmidi = list_entry(list, struct snd_virmidi, list);
+       list_for_each_entry(vmidi, &rdev->filelist, list) {
                if (!vmidi->trigger)
                        continue;
                if (ev->type == SNDRV_SEQ_EVENT_SYSEX) {
@@ -366,7 +363,7 @@ static int snd_virmidi_dev_attach_seq(struct snd_virmidi_dev *rdev)
        if (rdev->client >= 0)
                return 0;
 
-       pinfo = kmalloc(sizeof(*pinfo), GFP_KERNEL);
+       pinfo = kzalloc(sizeof(*pinfo), GFP_KERNEL);
        if (!pinfo) {
                err = -ENOMEM;
                goto __error;
@@ -383,7 +380,6 @@ static int snd_virmidi_dev_attach_seq(struct snd_virmidi_dev *rdev)
        rdev->client = client;
 
        /* create a port */
-       memset(pinfo, 0, sizeof(*pinfo));
        pinfo->addr.client = client;
        sprintf(pinfo->name, "VirMIDI %d-%d", rdev->card->number, rdev->device);
        /* set all capabilities */