Commit a996d010 authored by Jean Delvare's avatar Jean Delvare Committed by Greg Kroah-Hartman

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 b4028437.
Signed-off-by: default avatarJean Delvare <jdelvare@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d4332013
...@@ -587,19 +587,3 @@ void driver_detach(struct device_driver *drv) ...@@ -587,19 +587,3 @@ void driver_detach(struct device_driver *drv)
put_device(dev); 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);
...@@ -826,6 +826,16 @@ static inline void set_dev_node(struct device *dev, int node) ...@@ -826,6 +826,16 @@ static inline void set_dev_node(struct device *dev, int node)
} }
#endif #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) static inline struct pm_subsys_data *dev_to_psd(struct device *dev)
{ {
return dev ? dev->power.subsys_data : NULL; return dev ? dev->power.subsys_data : NULL;
...@@ -910,8 +920,6 @@ extern int device_move(struct device *dev, struct device *new_parent, ...@@ -910,8 +920,6 @@ extern int device_move(struct device *dev, struct device *new_parent,
extern const char *device_get_devnode(struct device *dev, extern const char *device_get_devnode(struct device *dev,
umode_t *mode, kuid_t *uid, kgid_t *gid, umode_t *mode, kuid_t *uid, kgid_t *gid,
const char **tmp); 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) static inline bool device_supports_offline(struct device *dev)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment