Commit 71d64290 authored by Marc Kleine-Budde's avatar Marc Kleine-Budde Committed by Greg Kroah-Hartman

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: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
Acked-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9194a595
...@@ -130,8 +130,15 @@ extern void platform_driver_unregister(struct platform_driver *); ...@@ -130,8 +130,15 @@ extern void platform_driver_unregister(struct platform_driver *);
extern int platform_driver_probe(struct platform_driver *driver, extern int platform_driver_probe(struct platform_driver *driver,
int (*probe)(struct platform_device *)); int (*probe)(struct platform_device *));
#define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev) static inline void *platform_get_drvdata(const struct platform_device *pdev)
#define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data)) {
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, extern struct platform_device *platform_create_bundle(struct platform_driver *driver,
int (*probe)(struct platform_device *), int (*probe)(struct platform_device *),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment