aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/atm/he.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2014-08-08 17:24:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-08 18:57:28 -0400
commit6f2a011afc324260d8e5e2aa480a58c34283c581 (patch)
tree158516a261527d7866cf83c2a1e88926eb7738a7 /drivers/atm/he.c
parent82bf0baad9768c21850d06ddc24ea47984c4c90f (diff)
atm: use pci_zalloc_consistent
Remove the now unnecessary memset too. Signed-off-by: Joe Perches <joe@perches.com> Cc: Chas Williams <chas@cmf.nrl.navy.mil> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/atm/he.c')
-rw-r--r--drivers/atm/he.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/drivers/atm/he.c b/drivers/atm/he.c
index aa6be2698669..c39702bc279d 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -533,14 +533,13 @@ static void he_init_tx_lbfp(struct he_dev *he_dev)
533 533
534static int he_init_tpdrq(struct he_dev *he_dev) 534static int he_init_tpdrq(struct he_dev *he_dev)
535{ 535{
536 he_dev->tpdrq_base = pci_alloc_consistent(he_dev->pci_dev, 536 he_dev->tpdrq_base = pci_zalloc_consistent(he_dev->pci_dev,
537 CONFIG_TPDRQ_SIZE * sizeof(struct he_tpdrq), &he_dev->tpdrq_phys); 537 CONFIG_TPDRQ_SIZE * sizeof(struct he_tpdrq),
538 &he_dev->tpdrq_phys);
538 if (he_dev->tpdrq_base == NULL) { 539 if (he_dev->tpdrq_base == NULL) {
539 hprintk("failed to alloc tpdrq\n"); 540 hprintk("failed to alloc tpdrq\n");
540 return -ENOMEM; 541 return -ENOMEM;
541 } 542 }
542 memset(he_dev->tpdrq_base, 0,
543 CONFIG_TPDRQ_SIZE * sizeof(struct he_tpdrq));
544 543
545 he_dev->tpdrq_tail = he_dev->tpdrq_base; 544 he_dev->tpdrq_tail = he_dev->tpdrq_base;
546 he_dev->tpdrq_head = he_dev->tpdrq_base; 545 he_dev->tpdrq_head = he_dev->tpdrq_base;
@@ -804,13 +803,13 @@ static int he_init_group(struct he_dev *he_dev, int group)
804 goto out_free_rbpl_virt; 803 goto out_free_rbpl_virt;
805 } 804 }
806 805
807 he_dev->rbpl_base = pci_alloc_consistent(he_dev->pci_dev, 806 he_dev->rbpl_base = pci_zalloc_consistent(he_dev->pci_dev,
808 CONFIG_RBPL_SIZE * sizeof(struct he_rbp), &he_dev->rbpl_phys); 807 CONFIG_RBPL_SIZE * sizeof(struct he_rbp),
808 &he_dev->rbpl_phys);
809 if (he_dev->rbpl_base == NULL) { 809 if (he_dev->rbpl_base == NULL) {
810 hprintk("failed to alloc rbpl_base\n"); 810 hprintk("failed to alloc rbpl_base\n");
811 goto out_destroy_rbpl_pool; 811 goto out_destroy_rbpl_pool;
812 } 812 }
813 memset(he_dev->rbpl_base, 0, CONFIG_RBPL_SIZE * sizeof(struct he_rbp));
814 813
815 INIT_LIST_HEAD(&he_dev->rbpl_outstanding); 814 INIT_LIST_HEAD(&he_dev->rbpl_outstanding);
816 815
@@ -843,13 +842,13 @@ static int he_init_group(struct he_dev *he_dev, int group)
843 842
844 /* rx buffer ready queue */ 843 /* rx buffer ready queue */
845 844
846 he_dev->rbrq_base = pci_alloc_consistent(he_dev->pci_dev, 845 he_dev->rbrq_base = pci_zalloc_consistent(he_dev->pci_dev,
847 CONFIG_RBRQ_SIZE * sizeof(struct he_rbrq), &he_dev->rbrq_phys); 846 CONFIG_RBRQ_SIZE * sizeof(struct he_rbrq),
847 &he_dev->rbrq_phys);
848 if (he_dev->rbrq_base == NULL) { 848 if (he_dev->rbrq_base == NULL) {
849 hprintk("failed to allocate rbrq\n"); 849 hprintk("failed to allocate rbrq\n");
850 goto out_free_rbpl; 850 goto out_free_rbpl;
851 } 851 }
852 memset(he_dev->rbrq_base, 0, CONFIG_RBRQ_SIZE * sizeof(struct he_rbrq));
853 852
854 he_dev->rbrq_head = he_dev->rbrq_base; 853 he_dev->rbrq_head = he_dev->rbrq_base;
855 he_writel(he_dev, he_dev->rbrq_phys, G0_RBRQ_ST + (group * 16)); 854 he_writel(he_dev, he_dev->rbrq_phys, G0_RBRQ_ST + (group * 16));
@@ -867,13 +866,13 @@ static int he_init_group(struct he_dev *he_dev, int group)
867 866
868 /* tx buffer ready queue */ 867 /* tx buffer ready queue */
869 868
870 he_dev->tbrq_base = pci_alloc_consistent(he_dev->pci_dev, 869 he_dev->tbrq_base = pci_zalloc_consistent(he_dev->pci_dev,
871 CONFIG_TBRQ_SIZE * sizeof(struct he_tbrq), &he_dev->tbrq_phys); 870 CONFIG_TBRQ_SIZE * sizeof(struct he_tbrq),
871 &he_dev->tbrq_phys);
872 if (he_dev->tbrq_base == NULL) { 872 if (he_dev->tbrq_base == NULL) {
873 hprintk("failed to allocate tbrq\n"); 873 hprintk("failed to allocate tbrq\n");
874 goto out_free_rbpq_base; 874 goto out_free_rbpq_base;
875 } 875 }
876 memset(he_dev->tbrq_base, 0, CONFIG_TBRQ_SIZE * sizeof(struct he_tbrq));
877 876
878 he_dev->tbrq_head = he_dev->tbrq_base; 877 he_dev->tbrq_head = he_dev->tbrq_base;
879 878
@@ -1460,13 +1459,13 @@ static int he_start(struct atm_dev *dev)
1460 1459
1461 /* host status page */ 1460 /* host status page */
1462 1461
1463 he_dev->hsp = pci_alloc_consistent(he_dev->pci_dev, 1462 he_dev->hsp = pci_zalloc_consistent(he_dev->pci_dev,
1464 sizeof(struct he_hsp), &he_dev->hsp_phys); 1463 sizeof(struct he_hsp),
1464 &he_dev->hsp_phys);
1465 if (he_dev->hsp == NULL) { 1465 if (he_dev->hsp == NULL) {
1466 hprintk("failed to allocate host status page\n"); 1466 hprintk("failed to allocate host status page\n");
1467 return -ENOMEM; 1467 return -ENOMEM;
1468 } 1468 }
1469 memset(he_dev->hsp, 0, sizeof(struct he_hsp));
1470 he_writel(he_dev, he_dev->hsp_phys, HSP_BA); 1469 he_writel(he_dev, he_dev->hsp_phys, HSP_BA);
1471 1470
1472 /* initialize framer */ 1471 /* initialize framer */