[PATCH 03/20] Driver core: Add accessor for device platform data

Greg Kroah-Hartman
2009-09-15T19:16:16Z

From: Mark Brown <broonie@opensource.wolfsonmicro.com>

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>
---
include/linux/device.h | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/include/linux/device.h b/include/linux/device.h
index c0bd230..3f33f17 100644
--- a/include/linux/device.h
+++ b/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);

+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
* for information on use.
--
1.6.4.2