Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Ben Collins and committed by
Linus Torvalds
cc0fa84a b62735d9

+12 -6
+10 -3
arch/powerpc/platforms/powermac/pfunc_core.c
··· 862 862 spin_unlock_irqrestore(&pmf_lock, flags); 863 863 return -ENODEV; 864 864 } 865 + if (list_empty(&func->irq_clients)) 866 + func->dev->handlers->irq_enable(func); 865 867 list_add(&client->link, &func->irq_clients); 868 + client->func = func; 866 869 spin_unlock_irqrestore(&pmf_lock, flags); 867 870 868 871 return 0; 869 872 } 870 873 EXPORT_SYMBOL_GPL(pmf_register_irq_client); 871 874 872 - void pmf_unregister_irq_client(struct device_node *np, 873 - const char *name, 874 - struct pmf_irq_client *client) 875 + void pmf_unregister_irq_client(struct pmf_irq_client *client) 875 876 { 877 + struct pmf_function *func = client->func; 876 878 unsigned long flags; 877 879 880 + BUG_ON(func == NULL); 881 + 878 882 spin_lock_irqsave(&pmf_lock, flags); 883 + client->func = NULL; 879 884 list_del(&client->link); 885 + if (list_empty(&func->irq_clients)) 886 + func->dev->handlers->irq_disable(func); 880 887 spin_unlock_irqrestore(&pmf_lock, flags); 881 888 } 882 889 EXPORT_SYMBOL_GPL(pmf_unregister_irq_client);
+2 -3
include/asm-powerpc/pmac_pfunc.h
··· 167 167 void *data; 168 168 struct module *owner; 169 169 struct list_head link; 170 + struct pmf_function *func; 170 171 }; 171 172 172 173 ··· 188 187 const char *name, 189 188 struct pmf_irq_client *client); 190 189 191 - extern void pmf_unregister_irq_client(struct device_node *np, 192 - const char *name, 193 - struct pmf_irq_client *client); 190 + extern void pmf_unregister_irq_client(struct pmf_irq_client *client); 194 191 195 192 /* 196 193 * Called by the handlers when an irq happens