diff options
author | H Hartley Sweeten <hartleys@visionengravers.com> | 2012-12-17 17:26:55 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2013-01-03 04:27:30 -0500 |
commit | 4d02c58eb1f19433cb852b2bde41c44849691614 (patch) | |
tree | 6f55ec250be450aac2ef9ccbe250ea2f6bb991dd /include/linux/hid.h | |
parent | fd62c5450324af7f6cc12897b09b77285cd48a92 (diff) |
HID: introduce helper for hid_driver boilerplate
Introduce the module_hid_driver macro which is a convenience macro
for HID driver modules similar to module_usb_driver. It is intended
to be used by drivers with init/exit sections that do nothing but
register/unregister the HID driver.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'include/linux/hid.h')
-rw-r--r-- | include/linux/hid.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h index 7330a0fef0c0..d6c71a674310 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -700,6 +700,18 @@ extern int __must_check __hid_register_driver(struct hid_driver *, | |||
700 | 700 | ||
701 | extern void hid_unregister_driver(struct hid_driver *); | 701 | extern void hid_unregister_driver(struct hid_driver *); |
702 | 702 | ||
703 | /** | ||
704 | * module_hid_driver() - Helper macro for registering a HID driver | ||
705 | * @__hid_driver: hid_driver struct | ||
706 | * | ||
707 | * Helper macro for HID drivers which do not do anything special in module | ||
708 | * init/exit. This eliminates a lot of boilerplate. Each module may only | ||
709 | * use this macro once, and calling it replaces module_init() and module_exit() | ||
710 | */ | ||
711 | #define module_hid_driver(__hid_driver) \ | ||
712 | module_driver(__hid_driver, hid_register_driver, \ | ||
713 | hid_unregister_driver) | ||
714 | |||
703 | extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); | 715 | extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); |
704 | extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report); | 716 | extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report); |
705 | extern int hidinput_connect(struct hid_device *hid, unsigned int force); | 717 | extern int hidinput_connect(struct hid_device *hid, unsigned int force); |