mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-11 20:09:26 +01:00
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 <[email protected]>
Acked-by: Uwe Kleine-König <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
1 parent
9194a595f7
commit
71d642908d
1 file changed
+9
-2
@@ -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 *),
|
||||
|
||||
Reference in new issue
Block a user