Driver core: convert platform_{get,set}_drvdata to static inline functions
authorMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 16 Feb 2011 22:23:27 +0000 (23:23 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Feb 2011 16:15:51 +0000 (08:15 -0800)
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>
include/linux/platform_device.h

index 2e700ec0601f79ed37b81cadcf3e0619f9c63785..d96db98257086cb51341af56d6f9db8615e0d462 100644 (file)
@@ -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 *),