diff options
author | Johan Hovold <johan@hovoldconsulting.com> | 2015-07-16 11:44:01 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2015-07-16 09:57:20 -0700 |
commit | 93047af23c8389d1a63883dcb59cd8c2fd472b45 (patch) | |
tree | 9308b6706cf63a6384c7d48e3c51f2cae2a9d834 /drivers/staging/greybus/kernel_ver.h | |
parent | 129a06f541d3ff4228589b4b9f0a4681dafb0042 (diff) |
greybus: kernel_ver: add list_last_entry for old kernels
Add list_last_entry macro for kernels older than 3.13.
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-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 | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/staging/greybus/kernel_ver.h b/drivers/staging/greybus/kernel_ver.h index 4fb949ba9b51..c2e92df9f417 100644 --- a/drivers/staging/greybus/kernel_ver.h +++ b/drivers/staging/greybus/kernel_ver.h @@ -235,4 +235,9 @@ static inline size_t sg_pcopy_from_buffer(struct scatterlist *sgl, } #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) +#define list_last_entry(ptr, type, member) \ + list_entry((ptr)->prev, type, member) +#endif + #endif /* __GREYBUS_KERNEL_VER_H */ |