diff options
Diffstat (limited to 'arch/powerpc/sysdev/pmi.c')
| -rw-r--r-- | arch/powerpc/sysdev/pmi.c | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/arch/powerpc/sysdev/pmi.c b/arch/powerpc/sysdev/pmi.c index aaa915998eb..5aaf86c0389 100644 --- a/arch/powerpc/sysdev/pmi.c +++ b/arch/powerpc/sysdev/pmi.c @@ -25,8 +25,10 @@ */ #include <linux/interrupt.h> +#include <linux/slab.h> #include <linux/completion.h> #include <linux/spinlock.h> +#include <linux/module.h> #include <linux/workqueue.h> #include <linux/of_device.h> #include <linux/of_platform.h> @@ -42,7 +44,7 @@ struct pmi_data { struct mutex msg_mutex; pmi_message_t msg; struct completion *completion; - struct of_device *dev; + struct platform_device *dev; int irq; u8 __iomem *pmi_reg; struct work_struct work; @@ -113,17 +115,16 @@ static void pmi_notify_handlers(struct work_struct *work) spin_lock(&data->handler_spinlock); list_for_each_entry(handler, &data->handler, node) { - pr_debug(KERN_INFO "pmi: notifying handler %p\n", handler); + pr_debug("pmi: notifying handler %p\n", handler); if (handler->type == data->msg.type) handler->handle_pmi_message(data->msg); } spin_unlock(&data->handler_spinlock); } -static int pmi_of_probe(struct of_device *dev, - const struct of_device_id *match) +static int pmi_of_probe(struct platform_device *dev) { - struct device_node *np = dev->node; + struct device_node *np = dev->dev.of_node; int rc; if (data) { @@ -184,7 +185,7 @@ out: return rc; } -static int pmi_of_remove(struct of_device *dev) +static int pmi_of_remove(struct platform_device *dev) { struct pmi_handler *handler, *tmp; @@ -204,26 +205,16 @@ static int pmi_of_remove(struct of_device *dev) return 0; } -static struct of_platform_driver pmi_of_platform_driver = { - .match_table = pmi_match, +static struct platform_driver pmi_of_platform_driver = { .probe = pmi_of_probe, .remove = pmi_of_remove, - .driver = { - .name = "pmi", + .driver = { + .name = "pmi", + .owner = THIS_MODULE, + .of_match_table = pmi_match, }, }; - -static int __init pmi_module_init(void) -{ - return of_register_platform_driver(&pmi_of_platform_driver); -} -module_init(pmi_module_init); - -static void __exit pmi_module_exit(void) -{ - of_unregister_platform_driver(&pmi_of_platform_driver); -} -module_exit(pmi_module_exit); +module_platform_driver(pmi_of_platform_driver); int pmi_send_message(pmi_message_t msg) { |
