From: Jean Delvare Date: Mon, 14 Apr 2014 10:58:53 +0000 (+0200) Subject: driver core: Inline dev_set/get_drvdata X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a996d010b648788b615938f6a26be6cf08d96aaf;p=linux-beck.git 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 Signed-off-by: Greg Kroah-Hartman --- 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) put_device(dev); } } - -/* - * These exports can't be _GPL due to .h files using this within them, and it - * might break something that was previously working... - */ -void *dev_get_drvdata(const struct device *dev) -{ - return dev->driver_data; -} -EXPORT_SYMBOL(dev_get_drvdata); - -void dev_set_drvdata(struct device *dev, void *data) -{ - dev->driver_data = data; -} -EXPORT_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) } #endif +static inline void *dev_get_drvdata(const struct device *dev) +{ + return dev->driver_data; +} + +static inline void dev_set_drvdata(struct device *dev, void *data) +{ + dev->driver_data = data; +} + static inline struct pm_subsys_data *dev_to_psd(struct device *dev) { return dev ? dev->power.subsys_data : NULL; @@ -910,8 +920,6 @@ extern int device_move(struct device *dev, struct device *new_parent, extern const char *device_get_devnode(struct device *dev, umode_t *mode, kuid_t *uid, kgid_t *gid, const char **tmp); -extern void *dev_get_drvdata(const struct device *dev); -extern void dev_set_drvdata(struct device *dev, void *data); static inline bool device_supports_offline(struct device *dev) {