summaryrefslogtreecommitdiff
path: root/include/linux/seqlock.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-10-27 14:52:29 +0300
committerTakashi Iwai <tiwai@suse.de>2014-10-27 14:52:29 +0300
commitd5432503bfb49f3425bad0b850714ffd8b533cfc (patch)
tree97926e7eea0b6d8b0e8bf98748dd9c0ef4c718ad /include/linux/seqlock.h
parent6a98e34b58919c52e8c8beec991759999af342da (diff)
parentc0d018bd5b1aabad59dffdec568e189359d93a14 (diff)
downloadlinux-d5432503bfb49f3425bad0b850714ffd8b533cfc.tar.xz
Merge tag 'asoc-v3.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v3.18 A few small driver fixes for v3.18 plus the removal of the s6000 support since the relevant chip is no longer supported in mainline.
Diffstat (limited to 'include/linux/seqlock.h')
-rw-r--r--include/linux/seqlock.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
index cc359636cfa3..f5df8f687b4d 100644
--- a/include/linux/seqlock.h
+++ b/include/linux/seqlock.h
@@ -456,4 +456,23 @@ read_sequnlock_excl_irqrestore(seqlock_t *sl, unsigned long flags)
spin_unlock_irqrestore(&sl->lock, flags);
}
+static inline unsigned long
+read_seqbegin_or_lock_irqsave(seqlock_t *lock, int *seq)
+{
+ unsigned long flags = 0;
+
+ if (!(*seq & 1)) /* Even */
+ *seq = read_seqbegin(lock);
+ else /* Odd */
+ read_seqlock_excl_irqsave(lock, flags);
+
+ return flags;
+}
+
+static inline void
+done_seqretry_irqrestore(seqlock_t *lock, int seq, unsigned long flags)
+{
+ if (seq & 1)
+ read_sequnlock_excl_irqrestore(lock, flags);
+}
#endif /* __LINUX_SEQLOCK_H */