提交 6f399d15 编写于 作者: C Christophe JAILLET 提交者: Yang Yingliang

media: v4l: cadence: Fix how unsued lanes are handled in 'csi2rx_start()'

commit 2eca8e4c1df4864b937752c3aa2f7925114f4806 upstream.

The 2nd parameter of 'find_first_zero_bit()' is a number of bits, not of
bytes. So use 'csi2rx->max_lanes' instead of 'sizeof(lanes_used)'.

Fixes: 1fc3b37f ("media: v4l: cadence: Add Cadence MIPI-CSI2 RX driver")
Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: NHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 57461587
...@@ -129,7 +129,7 @@ static int csi2rx_start(struct csi2rx_priv *csi2rx) ...@@ -129,7 +129,7 @@ static int csi2rx_start(struct csi2rx_priv *csi2rx)
*/ */
for (i = csi2rx->num_lanes; i < csi2rx->max_lanes; i++) { for (i = csi2rx->num_lanes; i < csi2rx->max_lanes; i++) {
unsigned int idx = find_first_zero_bit(&lanes_used, unsigned int idx = find_first_zero_bit(&lanes_used,
sizeof(lanes_used)); csi2rx->max_lanes);
set_bit(idx, &lanes_used); set_bit(idx, &lanes_used);
reg |= CSI2RX_STATIC_CFG_DLANE_MAP(i, i + 1); reg |= CSI2RX_STATIC_CFG_DLANE_MAP(i, i + 1);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册