diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2011-05-27 09:02:11 -0400 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2011-10-31 19:32:32 -0400 |
commit | eb5589a8f0dab7e29021344228856339e6a1249c (patch) | |
tree | d83790e5ac7feacba5b1832fbe7f8d2a39d76f65 /include/linux/hid.h | |
parent | 7c926402a7e8c9b279968fd94efec8700ba3859e (diff) |
include: convert various register fcns to macros to avoid include chaining
The original implementations reference THIS_MODULE in an inline.
We could include <linux/export.h>, but it is better to avoid chaining.
Fortunately someone else already thought of this, and made a similar
inline into a #define in <linux/device.h> for device_schedule_callback(),
[see commit 523ded71de0] so follow that precedent here.
Also bubble up any __must_check that were used on the prev. wrapper inline
functions up one to the real __register functions, to preserve any prev.
sanity checks that were used in those instances.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'include/linux/hid.h')
-rw-r--r-- | include/linux/hid.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h index deed5f9a1e1c..c235e4e8767c 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -697,10 +697,11 @@ extern void hid_destroy_device(struct hid_device *); | |||
697 | 697 | ||
698 | extern int __must_check __hid_register_driver(struct hid_driver *, | 698 | extern int __must_check __hid_register_driver(struct hid_driver *, |
699 | struct module *, const char *mod_name); | 699 | struct module *, const char *mod_name); |
700 | static inline int __must_check hid_register_driver(struct hid_driver *driver) | 700 | |
701 | { | 701 | /* use a define to avoid include chaining to get THIS_MODULE & friends */ |
702 | return __hid_register_driver(driver, THIS_MODULE, KBUILD_MODNAME); | 702 | #define hid_register_driver(driver) \ |
703 | } | 703 | __hid_register_driver(driver, THIS_MODULE, KBUILD_MODNAME) |
704 | |||
704 | extern void hid_unregister_driver(struct hid_driver *); | 705 | extern void hid_unregister_driver(struct hid_driver *); |
705 | 706 | ||
706 | extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); | 707 | extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); |