aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2011-02-16 17:23:27 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-02-18 11:15:51 -0500
commit71d642908d4e8e7a2a4a6e0490432e719ff466d5 (patch)
treec44e0c0fc5f4110f707b8f2fab243e28d19636a7
parent9194a595f756d2e428ddb8e74eb4932d39963aad (diff)
Driver core: convert platform_{get,set}_drvdata to static inline functions
This patch converts the macros for platform_{get,set}_drvdata to static inline functions to add typechecking. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--include/linux/platform_device.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 2e700ec0601f..d96db9825708 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 *);
130extern int platform_driver_probe(struct platform_driver *driver, 130extern int platform_driver_probe(struct platform_driver *driver,
131 int (*probe)(struct platform_device *)); 131 int (*probe)(struct platform_device *));
132 132
133#define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev) 133static inline void *platform_get_drvdata(const struct platform_device *pdev)
134#define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data)) 134{
135 return dev_get_drvdata(&pdev->dev);
136}
137
138static inline void platform_set_drvdata(struct platform_device *pdev, void *data)
139{
140 dev_set_drvdata(&pdev->dev, data);
141}
135 142
136extern struct platform_device *platform_create_bundle(struct platform_driver *driver, 143extern struct platform_device *platform_create_bundle(struct platform_driver *driver,
137 int (*probe)(struct platform_device *), 144 int (*probe)(struct platform_device *),