Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh...
[pandora-kernel.git] / drivers / staging / vme / bridges / vme_ca91cx42.c
index b9f986b..0c82eb4 100644 (file)
@@ -941,8 +941,7 @@ int ca91cx42_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
        dev = list->parent->parent->parent;
 
        /* XXX descriptor must be aligned on 64-bit boundaries */
-       entry = (struct ca91cx42_dma_entry *)
-               kmalloc(sizeof(struct ca91cx42_dma_entry), GFP_KERNEL);
+       entry = kmalloc(sizeof(struct ca91cx42_dma_entry), GFP_KERNEL);
        if (entry == NULL) {
                dev_err(dev, "Failed to allocate memory for dma resource "
                        "structure\n");
@@ -1495,7 +1494,7 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
        /* We want to support more than one of each bridge so we need to
         * dynamically allocate the bridge structure
         */
-       ca91cx42_bridge = kmalloc(sizeof(struct vme_bridge), GFP_KERNEL);
+       ca91cx42_bridge = kzalloc(sizeof(struct vme_bridge), GFP_KERNEL);
 
        if (ca91cx42_bridge == NULL) {
                dev_err(&pdev->dev, "Failed to allocate memory for device "
@@ -1504,9 +1503,7 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                goto err_struct;
        }
 
-       memset(ca91cx42_bridge, 0, sizeof(struct vme_bridge));
-
-       ca91cx42_device = kmalloc(sizeof(struct ca91cx42_driver), GFP_KERNEL);
+       ca91cx42_device = kzalloc(sizeof(struct ca91cx42_driver), GFP_KERNEL);
 
        if (ca91cx42_device == NULL) {
                dev_err(&pdev->dev, "Failed to allocate memory for device "
@@ -1515,8 +1512,6 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                goto err_driver;
        }
 
-       memset(ca91cx42_device, 0, sizeof(struct ca91cx42_driver));
-
        ca91cx42_bridge->driver_priv = ca91cx42_device;
 
        /* Enable the device */