diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2011-02-17 01:23:27 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-02-18 19:15:51 +0300 |
commit | 71d642908d4e8e7a2a4a6e0490432e719ff466d5 (patch) | |
tree | c44e0c0fc5f4110f707b8f2fab243e28d19636a7 /include | |
parent | 9194a595f756d2e428ddb8e74eb4932d39963aad (diff) | |
download | linux-71d642908d4e8e7a2a4a6e0490432e719ff466d5.tar.xz |
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>
Diffstat (limited to 'include')
-rw-r--r-- | 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 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 *); 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 *), |