[PATCH 32/50] Driver core: convert platform_{get,set}_drvdata to static inline functions

From: Greg Kroah-Hartman
Date: Wed Mar 16 2011 - 17:25:13 EST


From: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>

This patch converts the macros for platform_{get,set}_drvdata to
static inline functions to add typechecking.

Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
Acked-by: Uwe Kleine-KÃnig <u.kleine-koenig@xxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
---
include/linux/platform_device.h | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 2e700ec..d96db98 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -130,8 +130,15 @@ extern void platform_driver_unregister(struct platform_driver *);
extern int platform_driver_probe(struct platform_driver *driver,
int (*probe)(struct platform_device *));

-#define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev)
-#define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data))
+static inline void *platform_get_drvdata(const struct platform_device *pdev)
+{
+ return dev_get_drvdata(&pdev->dev);
+}
+
+static inline void platform_set_drvdata(struct platform_device *pdev, void *data)
+{
+ dev_set_drvdata(&pdev->dev, data);
+}

extern struct platform_device *platform_create_bundle(struct platform_driver *driver,
int (*probe)(struct platform_device *),
--
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/