'atomic_read()' -> refcount_read()'

The upstream 4.11 kernel, in commit (10383aea2f445bce9b2a2b308def08134b438c8e
"kref: Implement 'struct kref' using refcount_t"), changed refcount type on kref
objects. We now need to use refcount_read to read them.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
This commit is contained in:
Shaun Ruffell
2017-06-01 12:16:54 -05:00
committed by Tzafrir Cohen
parent ff88ccb1cd
commit 0159b0e7ce
5 changed files with 7 additions and 4 deletions

View File

@@ -1404,6 +1404,8 @@ static inline short dahdi_txtone_nextsample(struct dahdi_chan *ss)
/*! Maximum audio mask */
#define DAHDI_FORMAT_AUDIO_MASK ((1 << 16) - 1)
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
#define refcount_read atomic_read
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
/* DAHDI only was using the xxx_clear_bit variants. */
@@ -1533,6 +1535,7 @@ static inline int strcasecmp(const char *s1, const char *s2)
#endif /* 2.6.31 */
#endif /* 3.10.0 */
#endif /* 3.16.0 */
#endif /* 4.11.0 */
#ifndef DEFINE_SPINLOCK
#define DEFINE_SPINLOCK(x) spinlock_t x = SPIN_LOCK_UNLOCKED