Merge git://git.infradead.org/mtd-2.6
[powerpc.git] / sound / oss / trident.c
index 6b1f8c9..3bc1f6e 100644 (file)
@@ -18,7 +18,7 @@
  *     Ollie Lho <ollie@sis.com.tw> SiS 7018 Audio Core Support
  *     Ching-Ling Lee <cling-li@ali.com.tw> ALi 5451 Audio Core Support 
  *     Matt Wu <mattwu@acersoftech.com.cn> ALi 5451 Audio Core Support
- *     Peter Wächtler <pwaechtler@loewe-komp.de> CyberPro5050 support
+ *     Peter Wächtler <pwaechtler@loewe-komp.de> CyberPro5050 support
  *      Muli Ben-Yehuda <mulix@mulix.org>
  *
  *
@@ -89,7 +89,7 @@
  *     use set_current_state, properly release resources on failure in
  *     trident_probe, get rid of check_region
  *  v0.14.9c
- *     August 10 2001 Peter Wächtler <pwaechtler@loewe-komp.de>
+ *     August 10 2001 Peter Wächtler <pwaechtler@loewe-komp.de>
  *     added support for Tvia (formerly Integraphics/IGST) CyberPro5050
  *     this chip is often found in settop boxes (combined video+audio)
  *  v0.14.9b
 #include <linux/init.h>
 #include <linux/poll.h>
 #include <linux/spinlock.h>
-#include <linux/smp_lock.h>
 #include <linux/ac97_codec.h>
 #include <linux/bitops.h>
 #include <linux/proc_fs.h>
@@ -2729,12 +2728,11 @@ trident_open(struct inode *inode, struct file *file)
                }
                for (i = 0; i < NR_HW_CH; i++) {
                        if (card->states[i] == NULL) {
-                               state = card->states[i] = kmalloc(sizeof(*state), GFP_KERNEL);
+                               state = card->states[i] = kzalloc(sizeof(*state), GFP_KERNEL);
                                if (state == NULL) {
                                        mutex_unlock(&card->open_mutex);
                                        return -ENOMEM;
                                }
-                               memset(state, 0, sizeof(*state));
                                mutex_init(&state->sem);
                                dmabuf = &state->dmabuf;
                                goto found_virt;
@@ -3618,7 +3616,7 @@ ali_allocate_other_states_resources(struct trident_state *state, int chan_nums)
                        }
                        return -EBUSY;
                }
-               s = card->states[i] = kmalloc(sizeof(*state), GFP_KERNEL);
+               s = card->states[i] = kzalloc(sizeof(*state), GFP_KERNEL);
                if (!s) {
                        num = ali_multi_channels_5_1[state_count];
                        ali_free_pcm_channel(card, num);
@@ -3630,7 +3628,6 @@ ali_allocate_other_states_resources(struct trident_state *state, int chan_nums)
                        }
                        return -ENOMEM;
                }
-               memset(s, 0, sizeof(*state));
 
                s->dmabuf.channel = channel;
                s->dmabuf.ossfragshift = s->dmabuf.ossmaxfrags =
@@ -4399,11 +4396,10 @@ trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id)
        }
 
        rc = -ENOMEM;
-       if ((card = kmalloc(sizeof(*card), GFP_KERNEL)) == NULL) {
+       if ((card = kzalloc(sizeof(*card), GFP_KERNEL)) == NULL) {
                printk(KERN_ERR "trident: out of memory\n");
                goto out_release_region;
        }
-       memset(card, 0, sizeof (*card));
 
        init_timer(&card->timer);
        card->iobase = iobase;