diff options
Diffstat (limited to 'backport-include/linux/platform_device.h')
-rw-r--r-- | backport-include/linux/platform_device.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/backport-include/linux/platform_device.h b/backport-include/linux/platform_device.h new file mode 100644 index 0000000..d93f04b --- /dev/null +++ b/backport-include/linux/platform_device.h @@ -0,0 +1,42 @@ +#ifndef __BACKPORT_PLATFORM_DEVICE_H +#define __BACKPORT_PLATFORM_DEVICE_H + +#include_next <linux/platform_device.h> +#include <linux/version.h> + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0) +#define module_platform_driver_probe(__platform_driver, __platform_probe) \ +static int __init __platform_driver##_init(void) \ +{ \ + return platform_driver_probe(&(__platform_driver), \ + __platform_probe); \ +} \ +module_init(__platform_driver##_init); \ +static void __exit __platform_driver##_exit(void) \ +{ \ + platform_driver_unregister(&(__platform_driver)); \ +} \ +module_exit(__platform_driver##_exit); +#endif + +#ifndef PLATFORM_DEVID_NONE +#define PLATFORM_DEVID_NONE (-1) +#endif + +#ifndef PLATFORM_DEVID_AUTO +#define PLATFORM_DEVID_AUTO (-1) +#endif + +#ifndef module_platform_driver +#define module_platform_driver(__platform_driver) \ + module_driver(__platform_driver, platform_driver_register, \ + platform_driver_unregister) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) +#define platform_device_register_data LINUX_BACKPORT(platform_device_register_data) +extern struct platform_device *platform_device_register_data(struct device *, + const char *, int, const void *, size_t); +#endif + +#endif /* __BACKPORT_PLATFORM_DEVICE_H */ |