Commit 6d85befd authored by Patrick Mochel's avatar Patrick Mochel

Define input device class and register it.

parent 107b218e
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <linux/kmod.h> #include <linux/kmod.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/poll.h> #include <linux/poll.h>
#include <linux/device.h>
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("Input core"); MODULE_DESCRIPTION("Input core");
...@@ -808,10 +809,16 @@ static int input_handlers_read(char *buf, char **start, off_t pos, int count, in ...@@ -808,10 +809,16 @@ static int input_handlers_read(char *buf, char **start, off_t pos, int count, in
#endif #endif
struct device_class input_devclass = {
.name = "input",
};
static int __init input_init(void) static int __init input_init(void)
{ {
struct proc_dir_entry *entry; struct proc_dir_entry *entry;
devclass_register(&input_devclass);
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
proc_bus_input_dir = proc_mkdir("input", proc_bus); proc_bus_input_dir = proc_mkdir("input", proc_bus);
proc_bus_input_dir->owner = THIS_MODULE; proc_bus_input_dir->owner = THIS_MODULE;
...@@ -841,6 +848,7 @@ static void __exit input_exit(void) ...@@ -841,6 +848,7 @@ static void __exit input_exit(void)
devfs_unregister(input_devfs_handle); devfs_unregister(input_devfs_handle);
if (unregister_chrdev(INPUT_MAJOR, "input")) if (unregister_chrdev(INPUT_MAJOR, "input"))
printk(KERN_ERR "input: can't unregister char major %d", INPUT_MAJOR); printk(KERN_ERR "input: can't unregister char major %d", INPUT_MAJOR);
devclass_unregister(&input_devclass);
} }
module_init(input_init); module_init(input_init);
......
...@@ -912,5 +912,7 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in ...@@ -912,5 +912,7 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
#define input_report_ff(a,b,c) input_event(a, EV_FF, b, c) #define input_report_ff(a,b,c) input_event(a, EV_FF, b, c)
#define input_report_ff_status(a,b,c) input_event(a, EV_FF_STATUS, b, c) #define input_report_ff_status(a,b,c) input_event(a, EV_FF_STATUS, b, c)
extern struct device_class input_devclass;
#endif #endif
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment