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/device.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/device.h')
-rw-r--r-- | include/linux/device.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 85e78fc7d7fd..61f29f6a403d 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -723,10 +723,14 @@ extern int dev_set_drvdata(struct device *dev, void *data); | |||
723 | */ | 723 | */ |
724 | extern struct device *__root_device_register(const char *name, | 724 | extern struct device *__root_device_register(const char *name, |
725 | struct module *owner); | 725 | struct module *owner); |
726 | static inline struct device *root_device_register(const char *name) | 726 | |
727 | { | 727 | /* |
728 | return __root_device_register(name, THIS_MODULE); | 728 | * This is a macro to avoid include problems with THIS_MODULE, |
729 | } | 729 | * just as per what is done for device_schedule_callback() above. |
730 | */ | ||
731 | #define root_device_register(name) \ | ||
732 | __root_device_register(name, THIS_MODULE) | ||
733 | |||
730 | extern void root_device_unregister(struct device *root); | 734 | extern void root_device_unregister(struct device *root); |
731 | 735 | ||
732 | static inline void *dev_get_platdata(const struct device *dev) | 736 | static inline void *dev_get_platdata(const struct device *dev) |