aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorBen Collins <bcollins@ubuntu.com>2006-02-01 06:04:47 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-01 11:53:10 -0500
commitcc0fa84a01d328a1ad70076b90f08281c4c79f92 (patch)
treec588be11c6f3ed5888647444157c0a9ef5b28a57 /arch
parentb62735d9c6212de6fd1b5e96b41d978939fb0dd2 (diff)
[PATCH] powerpc: enable irq's for platform functions.
Make the platform function interrupt functions actually work. Calls irq_enable() for the first in the list, and irq_disable() for the last. Added *func to struct irq_client so the the user can pass just that to pmf_unregister_irq_client(). Signed-off-by: Ben Collins <bcollins@ubuntu.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/powermac/pfunc_core.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/powermac/pfunc_core.c b/arch/powerpc/platforms/powermac/pfunc_core.c
index c32c623001dc..356a739e52b2 100644
--- a/arch/powerpc/platforms/powermac/pfunc_core.c
+++ b/arch/powerpc/platforms/powermac/pfunc_core.c
@@ -862,21 +862,28 @@ int pmf_register_irq_client(struct device_node *target,
862 spin_unlock_irqrestore(&pmf_lock, flags); 862 spin_unlock_irqrestore(&pmf_lock, flags);
863 return -ENODEV; 863 return -ENODEV;
864 } 864 }
865 if (list_empty(&func->irq_clients))
866 func->dev->handlers->irq_enable(func);
865 list_add(&client->link, &func->irq_clients); 867 list_add(&client->link, &func->irq_clients);
868 client->func = func;
866 spin_unlock_irqrestore(&pmf_lock, flags); 869 spin_unlock_irqrestore(&pmf_lock, flags);
867 870
868 return 0; 871 return 0;
869} 872}
870EXPORT_SYMBOL_GPL(pmf_register_irq_client); 873EXPORT_SYMBOL_GPL(pmf_register_irq_client);
871 874
872void pmf_unregister_irq_client(struct device_node *np, 875void pmf_unregister_irq_client(struct pmf_irq_client *client)
873 const char *name,
874 struct pmf_irq_client *client)
875{ 876{
877 struct pmf_function *func = client->func;
876 unsigned long flags; 878 unsigned long flags;
877 879
880 BUG_ON(func == NULL);
881
878 spin_lock_irqsave(&pmf_lock, flags); 882 spin_lock_irqsave(&pmf_lock, flags);
883 client->func = NULL;
879 list_del(&client->link); 884 list_del(&client->link);
885 if (list_empty(&func->irq_clients))
886 func->dev->handlers->irq_disable(func);
880 spin_unlock_irqrestore(&pmf_lock, flags); 887 spin_unlock_irqrestore(&pmf_lock, flags);
881} 888}
882EXPORT_SYMBOL_GPL(pmf_unregister_irq_client); 889EXPORT_SYMBOL_GPL(pmf_unregister_irq_client);