Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / arch / arm / mach-iop3xx / iq80331-pci.c
index f37a0e2..40d8610 100644 (file)
@@ -13,6 +13,8 @@
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/init.h>
+#include <linux/string.h>
+#include <linux/slab.h>
 
 #include <asm/hardware.h>
 #include <asm/irq.h>
@@ -62,12 +64,10 @@ static int iq80331_setup(int nr, struct pci_sys_data *sys)
        if(nr != 0)
                return 0;
 
-       res = kmalloc(sizeof(struct resource) * 2, GFP_KERNEL);
+       res = kzalloc(sizeof(struct resource) * 2, GFP_KERNEL);
        if (!res)
                panic("PCI: unable to alloc resources");
 
-       memset(res, 0, sizeof(struct resource) * 2);
-
        res[0].start = IOP331_PCI_LOWER_IO_VA;
        res[0].end   = IOP331_PCI_UPPER_IO_VA;
        res[0].name  = "IQ80331 PCI I/O Space";