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 523ded71de] 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>
This commit is contained in:
Paul Gortmaker
2011-05-27 09:02:11 -04:00
parent 7c926402a7
commit eb5589a8f0
11 changed files with 57 additions and 58 deletions

View File

@ -697,10 +697,11 @@ extern void hid_destroy_device(struct hid_device *);
extern int __must_check __hid_register_driver(struct hid_driver *,
struct module *, const char *mod_name);
static inline int __must_check hid_register_driver(struct hid_driver *driver)
{
return __hid_register_driver(driver, THIS_MODULE, KBUILD_MODNAME);
}
/* use a define to avoid include chaining to get THIS_MODULE & friends */
#define hid_register_driver(driver) \
__hid_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)
extern void hid_unregister_driver(struct hid_driver *);
extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32);