mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-24 07:31:41 +00:00
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:
parent
7c926402a7
commit
eb5589a8f0
11 changed files with 57 additions and 58 deletions
|
@ -79,19 +79,21 @@ void serio_reconnect(struct serio *serio);
|
|||
irqreturn_t serio_interrupt(struct serio *serio, unsigned char data, unsigned int flags);
|
||||
|
||||
void __serio_register_port(struct serio *serio, struct module *owner);
|
||||
static inline void serio_register_port(struct serio *serio)
|
||||
{
|
||||
__serio_register_port(serio, THIS_MODULE);
|
||||
}
|
||||
|
||||
/* use a define to avoid include chaining to get THIS_MODULE */
|
||||
#define serio_register_port(serio) \
|
||||
__serio_register_port(serio, THIS_MODULE)
|
||||
|
||||
void serio_unregister_port(struct serio *serio);
|
||||
void serio_unregister_child_port(struct serio *serio);
|
||||
|
||||
int __serio_register_driver(struct serio_driver *drv, struct module *owner, const char *mod_name);
|
||||
static inline int __must_check serio_register_driver(struct serio_driver *drv)
|
||||
{
|
||||
return __serio_register_driver(drv, THIS_MODULE, KBUILD_MODNAME);
|
||||
}
|
||||
int __must_check __serio_register_driver(struct serio_driver *drv,
|
||||
struct module *owner, const char *mod_name);
|
||||
|
||||
/* use a define to avoid include chaining to get THIS_MODULE & friends */
|
||||
#define serio_register_driver(drv) \
|
||||
__serio_register_driver(drv, THIS_MODULE, KBUILD_MODNAME)
|
||||
|
||||
void serio_unregister_driver(struct serio_driver *drv);
|
||||
|
||||
static inline int serio_write(struct serio *serio, unsigned char data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue