浏览代码

Driver core: Add accessor for device platform data

For consistency with driver data provide a dev_get_platdata() accessor
for reading the platform data from a device.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Mark Brown 16 年之前
父节点
当前提交
a5b8b1ada6
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      include/linux/device.h

+ 5 - 0
include/linux/device.h

@@ -494,6 +494,11 @@ static inline struct device *root_device_register(const char *name)
 }
 }
 extern void root_device_unregister(struct device *root);
 extern void root_device_unregister(struct device *root);
 
 
+static inline void *dev_get_platdata(const struct device *dev)
+{
+	return dev->platform_data;
+}
+
 /*
 /*
  * Manual binding of a device to driver. See drivers/base/bus.c
  * Manual binding of a device to driver. See drivers/base/bus.c
  * for information on use.
  * for information on use.