aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2014-04-14 06:58:53 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-05-27 16:46:59 -0400
commita996d010b648788b615938f6a26be6cf08d96aaf (patch)
treef6e9e8c327e7eccd191b42bb3055c9d9a13d5245
parentd4332013919aa87dbdede67d677e4cf2cd32e898 (diff)
driver core: Inline dev_set/get_drvdata
dev_set_drvdata and dev_get_drvdata are now simple enough again that we can inline them as they used to be before commit b40284378. Signed-off-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/base/dd.c16
-rw-r--r--include/linux/device.h12
2 files changed, 10 insertions, 18 deletions
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index ba03353ff243..e4ffbcf2f519 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -587,19 +587,3 @@ void driver_detach(struct device_driver *drv)
587 put_device(dev); 587 put_device(dev);
588 } 588 }
589} 589}
590
591/*
592 * These exports can't be _GPL due to .h files using this within them, and it
593 * might break something that was previously working...
594 */
595void *dev_get_drvdata(const struct device *dev)
596{
597 return dev->driver_data;
598}
599EXPORT_SYMBOL(dev_get_drvdata);
600
601void dev_set_drvdata(struct device *dev, void *data)
602{
603 dev->driver_data = data;
604}
605EXPORT_SYMBOL(dev_set_drvdata);
diff --git a/include/linux/device.h b/include/linux/device.h
index 6d3a75773cd4..1b18c886445c 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -826,6 +826,16 @@ static inline void set_dev_node(struct device *dev, int node)
826} 826}
827#endif 827#endif
828 828
829static inline void *dev_get_drvdata(const struct device *dev)
830{
831 return dev->driver_data;
832}
833
834static inline void dev_set_drvdata(struct device *dev, void *data)
835{
836 dev->driver_data = data;
837}
838
829static inline struct pm_subsys_data *dev_to_psd(struct device *dev) 839static inline struct pm_subsys_data *dev_to_psd(struct device *dev)
830{ 840{
831 return dev ? dev->power.subsys_data : NULL; 841 return dev ? dev->power.subsys_data : NULL;
@@ -910,8 +920,6 @@ extern int device_move(struct device *dev, struct device *new_parent,
910extern const char *device_get_devnode(struct device *dev, 920extern const char *device_get_devnode(struct device *dev,
911 umode_t *mode, kuid_t *uid, kgid_t *gid, 921 umode_t *mode, kuid_t *uid, kgid_t *gid,
912 const char **tmp); 922 const char **tmp);
913extern void *dev_get_drvdata(const struct device *dev);
914extern void dev_set_drvdata(struct device *dev, void *data);
915 923
916static inline bool device_supports_offline(struct device *dev) 924static inline bool device_supports_offline(struct device *dev)
917{ 925{