greybus: kernel_ver: add list_last_entry for old kernels
authorJohan Hovold <johan@hovoldconsulting.com>
Thu, 16 Jul 2015 09:44:01 +0000 (11:44 +0200)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 16 Jul 2015 16:57:20 +0000 (09:57 -0700)
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>
drivers/staging/greybus/kernel_ver.h

index 4fb949ba9b5151ee774c107e42bc58b450dc8312..c2e92df9f4172daaebf7662f3c51e5ac7cbef6d5 100644 (file)
@@ -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 */