aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2006-06-19 14:33:26 -0400
committerPaul Mackerras <paulus@samba.org>2006-06-21 01:01:30 -0400
commitecec21770d87a5035cfd210cfdb22e1935b0c4a6 (patch)
tree889884e4dd6ca476686197846a90f8bd551a3521 /arch
parent970f1baae78ff99b7536464214d4c78dde4551e2 (diff)
[POWERPC] spufs: use kzalloc in create_spu
Clean up create_spu() a little by using kzalloc instead of kmalloc + assignments. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index fd6ea571dbd3..eb367dd89a7d 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -701,7 +701,7 @@ static int __init create_spu(struct device_node *spe)
701 static int number; 701 static int number;
702 702
703 ret = -ENOMEM; 703 ret = -ENOMEM;
704 spu = kmalloc(sizeof (*spu), GFP_KERNEL); 704 spu = kzalloc(sizeof (*spu), GFP_KERNEL);
705 if (!spu) 705 if (!spu)
706 goto out; 706 goto out;
707 707
@@ -713,28 +713,11 @@ static int __init create_spu(struct device_node *spe)
713 spu->nid = of_node_to_nid(spe); 713 spu->nid = of_node_to_nid(spe);
714 if (spu->nid == -1) 714 if (spu->nid == -1)
715 spu->nid = 0; 715 spu->nid = 0;
716
717 spu->stop_code = 0;
718 spu->slb_replace = 0;
719 spu->mm = NULL;
720 spu->ctx = NULL;
721 spu->rq = NULL;
722 spu->pid = 0;
723 spu->class_0_pending = 0;
724 spu->flags = 0UL;
725 spu->dar = 0UL;
726 spu->dsisr = 0UL;
727 spin_lock_init(&spu->register_lock); 716 spin_lock_init(&spu->register_lock);
728
729 spu_mfc_sdr_set(spu, mfspr(SPRN_SDR1)); 717 spu_mfc_sdr_set(spu, mfspr(SPRN_SDR1));
730 spu_mfc_sr1_set(spu, 0x33); 718 spu_mfc_sr1_set(spu, 0x33);
731
732 spu->ibox_callback = NULL;
733 spu->wbox_callback = NULL;
734 spu->stop_callback = NULL;
735 spu->mfc_callback = NULL;
736
737 mutex_lock(&spu_mutex); 719 mutex_lock(&spu_mutex);
720
738 spu->number = number++; 721 spu->number = number++;
739 ret = spu_request_irqs(spu); 722 ret = spu_request_irqs(spu);
740 if (ret) 723 if (ret)