aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2007-04-23 15:08:28 -0400
committerArnd Bergmann <arnd@klappe.arndb.de>2007-04-23 15:18:59 -0400
commitbefdc746ee027d686a06be29cb1391f9d2c45cf6 (patch)
treecb9a5e2dc1318bb0c34a719cd29deca99dbf91ad
parentaa45e2569ffe963dfbbbfddfdccd12afe69b2d65 (diff)
[POWERPC] spu_base: remove cleanup_spu_base
spu_base.c is always built into the kernel image, so there is no need for a cleanup function. And some of the things it does are in the way for my following patches, so I'd rather get rid of it ASAP. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c47
1 files changed, 10 insertions, 37 deletions
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index 31fa55f33415..2e8aa9433b3b 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -534,12 +534,6 @@ static int spu_create_sysdev(struct spu *spu)
534 return 0; 534 return 0;
535} 535}
536 536
537static void spu_destroy_sysdev(struct spu *spu)
538{
539 sysfs_remove_device_from_node(&spu->sysdev, spu->node);
540 sysdev_unregister(&spu->sysdev);
541}
542
543static int __init create_spu(void *data) 537static int __init create_spu(void *data)
544{ 538{
545 struct spu *spu; 539 struct spu *spu;
@@ -591,43 +585,17 @@ out:
591 return ret; 585 return ret;
592} 586}
593 587
594static void destroy_spu(struct spu *spu)
595{
596 list_del_init(&spu->list);
597 list_del_init(&spu->full_list);
598
599 spu_destroy_sysdev(spu);
600 spu_free_irqs(spu);
601 spu_destroy_spu(spu);
602 kfree(spu);
603}
604
605static void cleanup_spu_base(void)
606{
607 struct spu *spu, *tmp;
608 int node;
609
610 mutex_lock(&spu_mutex);
611 for (node = 0; node < MAX_NUMNODES; node++) {
612 list_for_each_entry_safe(spu, tmp, &spu_list[node], list)
613 destroy_spu(spu);
614 }
615 mutex_unlock(&spu_mutex);
616 sysdev_class_unregister(&spu_sysdev_class);
617}
618module_exit(cleanup_spu_base);
619
620static int __init init_spu_base(void) 588static int __init init_spu_base(void)
621{ 589{
622 int i, ret; 590 int i, ret = 0;
623 591
624 if (!spu_management_ops) 592 if (!spu_management_ops)
625 return 0; 593 goto out;
626 594
627 /* create sysdev class for spus */ 595 /* create sysdev class for spus */
628 ret = sysdev_class_register(&spu_sysdev_class); 596 ret = sysdev_class_register(&spu_sysdev_class);
629 if (ret) 597 if (ret)
630 return ret; 598 goto out;
631 599
632 for (i = 0; i < MAX_NUMNODES; i++) 600 for (i = 0; i < MAX_NUMNODES; i++)
633 INIT_LIST_HEAD(&spu_list[i]); 601 INIT_LIST_HEAD(&spu_list[i]);
@@ -637,12 +605,17 @@ static int __init init_spu_base(void)
637 if (ret) { 605 if (ret) {
638 printk(KERN_WARNING "%s: Error initializing spus\n", 606 printk(KERN_WARNING "%s: Error initializing spus\n",
639 __FUNCTION__); 607 __FUNCTION__);
640 cleanup_spu_base(); 608 goto out_unregister_sysdev_class;
641 return ret;
642 } 609 }
643 610
644 xmon_register_spus(&spu_full_list); 611 xmon_register_spus(&spu_full_list);
645 612
613 return 0;
614
615 out_unregister_sysdev_class:
616 sysdev_class_unregister(&spu_sysdev_class);
617 out:
618
646 return ret; 619 return ret;
647} 620}
648module_init(init_spu_base); 621module_init(init_spu_base);