diff options
author | Dominik Sliwa <dominik.sliwa@toradex.com> | 2017-12-22 12:07:34 +0000 |
---|---|---|
committer | Dominik Sliwa <dominik.sliwa@toradex.com> | 2018-09-18 17:15:11 +0200 |
commit | 69ff0b5709d0d06545fcb2d08c7645b56d3687dd (patch) | |
tree | 71f1569cc019e16c1b1be22c1e8d382766daebb3 /backport-include/linux/kref.h | |
parent | d6a47bfb72f495a72637fbe635220f6af0f4cb6f (diff) |
backports: bluetooth: Support 4.9 kernels
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Diffstat (limited to 'backport-include/linux/kref.h')
-rw-r--r-- | backport-include/linux/kref.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/backport-include/linux/kref.h b/backport-include/linux/kref.h new file mode 100644 index 0000000..631488f --- /dev/null +++ b/backport-include/linux/kref.h @@ -0,0 +1,13 @@ +#ifndef __BACKPORT_LINUX_KREF_H +#define __BACKPORT_LINUX_KREF_H +#include_next <linux/kref.h> + +#if LINUX_VERSION_IS_LESS(4,11,0) +#include <linux/refcount.h> +static inline unsigned int kref_read(const struct kref *kref) +{ + return refcount_read((const refcount_t *)&kref->refcount); +} +#endif /* < 4.11 */ + +#endif /* __BACKPORT_LINUX_KREF_H */ |