From 67b37bef315c0554b0a6a48f39c69753dcb043de Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 30 Nov 2013 20:54:39 +0100 Subject: [PATCH] backports: check for define in module_driver and not kernel version In some places backports checked for the kernel version on weather to add a own define for module_driver or not. This patch makes it check if there is already one or not. Signed-off-by: Hauke Mehrtens Signed-off-by: Luis R. Rodriguez --- backport/backport-include/linux/device.h | 2 +- backport/backport-include/linux/pci.h | 2 +- backport/backport-include/linux/platform_device.h | 2 +- backport/backport-include/linux/usb.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backport/backport-include/linux/device.h b/backport/backport-include/linux/device.h index e1d7bb7fe705..198aec470e8e 100644 --- a/backport/backport-include/linux/device.h +++ b/backport/backport-include/linux/device.h @@ -29,7 +29,7 @@ backport_device_move(struct device *dev, struct device *new_parent, #define device_move LINUX_BACKPORT(device_move) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) +#ifndef module_driver /** * module_driver() - Helper macro for drivers that don't do anything * special in module init/exit. This eliminates a lot of boilerplate. diff --git a/backport/backport-include/linux/pci.h b/backport/backport-include/linux/pci.h index e309586d2345..208278d42349 100644 --- a/backport/backport-include/linux/pci.h +++ b/backport/backport-include/linux/pci.h @@ -70,7 +70,7 @@ #define compat_pci_resume(fn) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0) +#ifndef module_pci_driver /** * module_pci_driver() - Helper macro for registering a PCI driver * @__pci_driver: pci_driver struct diff --git a/backport/backport-include/linux/platform_device.h b/backport/backport-include/linux/platform_device.h index d93f04b46441..3735cc871c21 100644 --- a/backport/backport-include/linux/platform_device.h +++ b/backport/backport-include/linux/platform_device.h @@ -4,7 +4,7 @@ #include_next #include -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0) +#ifndef module_platform_driver_probe #define module_platform_driver_probe(__platform_driver, __platform_probe) \ static int __init __platform_driver##_init(void) \ { \ diff --git a/backport/backport-include/linux/usb.h b/backport/backport-include/linux/usb.h index a5c2f2bc29e8..7f5ba20c8722 100644 --- a/backport/backport-include/linux/usb.h +++ b/backport/backport-include/linux/usb.h @@ -4,7 +4,7 @@ #include_next #include -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) +#ifndef module_usb_driver /** * module_usb_driver() - Helper macro for registering a USB driver * @__usb_driver: usb_driver struct -- 2.30.2