summaryrefslogtreecommitdiff
path: root/include/linux/qed/qed_chain.h
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2016-03-04 22:32:40 +0300
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2016-03-04 22:32:40 +0300
commit52cdce8adb635746f53306ab2599ca64902bb1dc (patch)
tree0b61680c30eb150796cf01186f15b4845cdee6dd /include/linux/qed/qed_chain.h
parent3cd47869431d7402d0613cf0f7fbb392f2b97565 (diff)
parent7dde4e74744772efdc85d7ed13495c7b6a0d881b (diff)
downloadlinux-52cdce8adb635746f53306ab2599ca64902bb1dc.tar.xz
Merge branch 'rotary-encoder' into next
Bring in updates to roraty encoder driver switching it away from legacy platform data and over to generic device properties and adding support for encoders using more than 2 GPIOs.
Diffstat (limited to 'include/linux/qed/qed_chain.h')
-rw-r--r--include/linux/qed/qed_chain.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/qed/qed_chain.h b/include/linux/qed/qed_chain.h
index b920c3605c46..41b9049b57e2 100644
--- a/include/linux/qed/qed_chain.h
+++ b/include/linux/qed/qed_chain.h
@@ -111,7 +111,8 @@ static inline u16 qed_chain_get_elem_left(struct qed_chain *p_chain)
used = ((u32)0x10000u + (u32)(p_chain->prod_idx)) -
(u32)p_chain->cons_idx;
if (p_chain->mode == QED_CHAIN_MODE_NEXT_PTR)
- used -= (used / p_chain->elem_per_page);
+ used -= p_chain->prod_idx / p_chain->elem_per_page -
+ p_chain->cons_idx / p_chain->elem_per_page;
return p_chain->capacity - used;
}