diff options
author | Alex Elder <elder@linaro.org> | 2015-05-07 13:00:21 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2015-05-07 22:55:43 +0200 |
commit | 5c58640d8d66504c43c062e6e7d4ed0ade6bde9e (patch) | |
tree | 62a4a1e06c1c100bd8928c561816669ad93765c1 /drivers/staging/greybus/kernel_ver.h | |
parent | 9ade6d312287fd1729a02e349f5f23483ffc4e1c (diff) |
greybus: battery: use feature tag rather than kernel version
Conditionally define a new symbol DRIVER_OWNS_PSY_STRUCT, which is
set in "kernel_ver.h" based on on the kernel version. Use it to
distinguish code used for kernels that differ in whether a power
supply structure is owned by the driver, or by the power supply
core.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/kernel_ver.h')
-rw-r--r-- | drivers/staging/greybus/kernel_ver.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/staging/greybus/kernel_ver.h b/drivers/staging/greybus/kernel_ver.h index e63d6cb58ce7..8b8e712df48e 100644 --- a/drivers/staging/greybus/kernel_ver.h +++ b/drivers/staging/greybus/kernel_ver.h @@ -15,6 +15,12 @@ #define __GREYBUS_KERNEL_VER_H #include <linux/kernel.h> +#include <linux/version.h> + +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0) +/* Commit: 297d716 power_supply: Change ownership from driver to core */ +#define DRIVER_OWNS_PSY_STRUCT +#endif #ifndef __ATTR_WO #define __ATTR_WO(_name) { \ @@ -57,7 +63,6 @@ * 3.17, which they explicitly changed in the 3.17 kernel. Consistency is * overrated. */ -#include <linux/version.h> #include <linux/gpio.h> #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0) |