Skip to content

Commit a5b8b1a

Browse files
brooniegregkh
authored andcommitted
Driver core: Add accessor for device platform data
For consistency with driver data provide a dev_get_platdata() accessor for reading the platform data from a device. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent b402843 commit a5b8b1a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎include/linux/device.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,11 @@ static inline struct device *root_device_register(const char *name)
494494
}
495495
extern void root_device_unregister(struct device *root);
496496

497+
static inline void *dev_get_platdata(const struct device *dev)
498+
{
499+
return dev->platform_data;
500+
}
501+
497502
/*
498503
* Manual binding of a device to driver. See drivers/base/bus.c
499504
* for information on use.

0 commit comments

Comments
 (0)