]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
media: v4l: cadence: Fix how unsued lanes are handled in 'csi2rx_start()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 13 Sep 2019 19:06:47 +0000 (16:06 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 10 Oct 2019 10:19:13 +0000 (07:19 -0300)
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: 1fc3b37f34f6 ("media: v4l: cadence: Add Cadence MIPI-CSI2 RX driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/cadence/cdns-csi2rx.c

index 31ace114eda14ea788350f07a94402473140bdce..be9ec59774d6d8a8e45a2b29250ebb7a1abfd9ed 100644 (file)
@@ -129,7 +129,7 @@ static int csi2rx_start(struct csi2rx_priv *csi2rx)
         */
        for (i = csi2rx->num_lanes; i < csi2rx->max_lanes; i++) {
                unsigned int idx = find_first_zero_bit(&lanes_used,
-                                                      sizeof(lanes_used));
+                                                      csi2rx->max_lanes);
                set_bit(idx, &lanes_used);
                reg |= CSI2RX_STATIC_CFG_DLANE_MAP(i, i + 1);
        }