diff options
-rw-r--r-- | arch/powerpc/platforms/powermac/pfunc_core.c | 13 | ||||
-rw-r--r-- | include/asm-powerpc/pmac_pfunc.h | 5 |
2 files changed, 12 insertions, 6 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 | } |
870 | EXPORT_SYMBOL_GPL(pmf_register_irq_client); | 873 | EXPORT_SYMBOL_GPL(pmf_register_irq_client); |
871 | 874 | ||
872 | void pmf_unregister_irq_client(struct device_node *np, | 875 | void 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 | } |
882 | EXPORT_SYMBOL_GPL(pmf_unregister_irq_client); | 889 | EXPORT_SYMBOL_GPL(pmf_unregister_irq_client); |
diff --git a/include/asm-powerpc/pmac_pfunc.h b/include/asm-powerpc/pmac_pfunc.h index d9728c80f86d..cef61304ffc2 100644 --- a/include/asm-powerpc/pmac_pfunc.h +++ b/include/asm-powerpc/pmac_pfunc.h | |||
@@ -167,6 +167,7 @@ struct pmf_irq_client { | |||
167 | void *data; | 167 | void *data; |
168 | struct module *owner; | 168 | struct module *owner; |
169 | struct list_head link; | 169 | struct list_head link; |
170 | struct pmf_function *func; | ||
170 | }; | 171 | }; |
171 | 172 | ||
172 | 173 | ||
@@ -187,9 +188,7 @@ extern int pmf_register_irq_client(struct device_node *np, | |||
187 | const char *name, | 188 | const char *name, |
188 | struct pmf_irq_client *client); | 189 | struct pmf_irq_client *client); |
189 | 190 | ||
190 | extern void pmf_unregister_irq_client(struct device_node *np, | 191 | extern void pmf_unregister_irq_client(struct pmf_irq_client *client); |
191 | const char *name, | ||
192 | struct pmf_irq_client *client); | ||
193 | 192 | ||
194 | /* | 193 | /* |
195 | * Called by the handlers when an irq happens | 194 | * Called by the handlers when an irq happens |