diff options
author | Johan Hovold <johan@hovoldconsulting.com> | 2016-05-27 17:26:38 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2016-05-27 12:24:17 -0700 |
commit | e3fbe484323a026ed3689c72bac186ab2009dbcb (patch) | |
tree | 3ba6013c3d736dcaf3f772aa9c4d2bafd767deed /drivers/staging | |
parent | 800d6c8f4e66cc6ff3737b4de1272c31cd9e1e3c (diff) |
greybus: kernel_ver: backport reinit_completion to pre-3.13
Backport upstream reinit_completion() to pre-3.13 kernels.
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/greybus/kernel_ver.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/staging/greybus/kernel_ver.h b/drivers/staging/greybus/kernel_ver.h index f5e62ed3d9f5..f6fb3bfcfe7a 100644 --- a/drivers/staging/greybus/kernel_ver.h +++ b/drivers/staging/greybus/kernel_ver.h @@ -313,4 +313,19 @@ static inline bool led_sysfs_is_disabled(struct led_classdev *led_cdev) #define SPI_NOR_MODALIAS "m25p80" #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) +/** + * reinit_completion - reinitialize a completion structure + * @x: pointer to completion structure that is to be reinitialized + * + * This inline function should be used to reinitialize a completion structure + * so it can be reused. This is especially important after complete_all() is + * used. + */ +static inline void reinit_completion(struct completion *x) +{ + x->done = 0; +} +#endif + #endif /* __GREYBUS_KERNEL_VER_H */ |