]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
vme: bridges: use pci_zalloc_consistent
authorJoe Perches <joe@perches.com>
Thu, 26 Jun 2014 00:43:20 +0000 (10:43 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 27 Jun 2014 04:21:51 +0000 (14:21 +1000)
Remove the now unnecessary memset too.

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Martyn Welch <martyn.welch@ge.com>
Cc: Manohar Vanga <manohar.vanga@gmail.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/vme/bridges/vme_ca91cx42.c
drivers/vme/bridges/vme_tsi148.c

index bfb2d3f06738481d302e7edb3550addbbb6a4691..18078ecbfcc6bfb5c68b173bd256ba9f63793244 100644 (file)
@@ -1555,16 +1555,14 @@ static int ca91cx42_crcsr_init(struct vme_bridge *ca91cx42_bridge,
        }
 
        /* Allocate mem for CR/CSR image */
-       bridge->crcsr_kernel = pci_alloc_consistent(pdev, VME_CRCSR_BUF_SIZE,
-               &bridge->crcsr_bus);
+       bridge->crcsr_kernel = pci_zalloc_consistent(pdev, VME_CRCSR_BUF_SIZE,
+                                                    &bridge->crcsr_bus);
        if (bridge->crcsr_kernel == NULL) {
                dev_err(&pdev->dev, "Failed to allocate memory for CR/CSR "
                        "image\n");
                return -ENOMEM;
        }
 
-       memset(bridge->crcsr_kernel, 0, VME_CRCSR_BUF_SIZE);
-
        crcsr_addr = slot * (512 * 1024);
        iowrite32(bridge->crcsr_bus - crcsr_addr, bridge->base + VCSR_TO);
 
index 61e706c0e00c6f6435d89ad5a23d9d887bd23bec..e07cfa8001bbf0ab2a253eae50b6290c3a60a984 100644 (file)
@@ -2275,16 +2275,14 @@ static int tsi148_crcsr_init(struct vme_bridge *tsi148_bridge,
        bridge = tsi148_bridge->driver_priv;
 
        /* Allocate mem for CR/CSR image */
-       bridge->crcsr_kernel = pci_alloc_consistent(pdev, VME_CRCSR_BUF_SIZE,
-               &bridge->crcsr_bus);
+       bridge->crcsr_kernel = pci_zalloc_consistent(pdev, VME_CRCSR_BUF_SIZE,
+                                                    &bridge->crcsr_bus);
        if (bridge->crcsr_kernel == NULL) {
                dev_err(tsi148_bridge->parent, "Failed to allocate memory for "
                        "CR/CSR image\n");
                return -ENOMEM;
        }
 
-       memset(bridge->crcsr_kernel, 0, VME_CRCSR_BUF_SIZE);
-
        reg_split(bridge->crcsr_bus, &crcsr_bus_high, &crcsr_bus_low);
 
        iowrite32be(crcsr_bus_high, bridge->base + TSI148_LCSR_CROU);