mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 08:31:13 +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
|
@ -723,10 +723,14 @@ extern int dev_set_drvdata(struct device *dev, void *data);
|
|||
*/
|
||||
extern struct device *__root_device_register(const char *name,
|
||||
struct module *owner);
|
||||
static inline struct device *root_device_register(const char *name)
|
||||
{
|
||||
return __root_device_register(name, THIS_MODULE);
|
||||
}
|
||||
|
||||
/*
|
||||
* This is a macro to avoid include problems with THIS_MODULE,
|
||||
* just as per what is done for device_schedule_callback() above.
|
||||
*/
|
||||
#define root_device_register(name) \
|
||||
__root_device_register(name, THIS_MODULE)
|
||||
|
||||
extern void root_device_unregister(struct device *root);
|
||||
|
||||
static inline void *dev_get_platdata(const struct device *dev)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue