summaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/st-vgxy61.c
diff options
context:
space:
mode:
authorBenjamin Mugnier <benjamin.mugnier@foss.st.com>2023-02-01 15:04:17 +0100
committerMauro Carvalho Chehab <mchehab@kernel.org>2023-03-20 00:36:53 +0100
commitc2402afcd338b61a7626968a5e9728594459a5de (patch)
treeb77721075d794676415899b2c1d51542d2fad20c /drivers/media/i2c/st-vgxy61.c
parentmedia: i2c: st-vgxy61: Fix control flow error on probe (diff)
downloadlinux-c2402afcd338b61a7626968a5e9728594459a5de.tar.xz
linux-c2402afcd338b61a7626968a5e9728594459a5de.zip
media: i2c: st-vgxy61: Use VGXY61_NB_POLARITIES instead of hardcoded value in tx_from_ep
tx_from_ep's for loop uses '5' as bound, while in fact it refers to the number of polarities. Replace it by VGXY61_NB_POLARITIES for factorization. Signed-off-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/i2c/st-vgxy61.c')
-rw-r--r--drivers/media/i2c/st-vgxy61.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/i2c/st-vgxy61.c b/drivers/media/i2c/st-vgxy61.c
index 76db976e054d..adbd093ad190 100644
--- a/drivers/media/i2c/st-vgxy61.c
+++ b/drivers/media/i2c/st-vgxy61.c
@@ -1548,7 +1548,7 @@ static int vgxy61_tx_from_ep(struct vgxy61_dev *sensor,
sensor->nb_of_lane = l_nb;
dev_dbg(&client->dev, "tx uses %d lanes", l_nb);
- for (i = 0; i < 5; i++) {
+ for (i = 0; i < VGXY61_NB_POLARITIES; i++) {
dev_dbg(&client->dev, "log2phy[%d] = %d\n", i, log2phy[i]);
dev_dbg(&client->dev, "phy2log[%d] = %d\n", i, phy2log[i]);
dev_dbg(&client->dev, "polarity[%d] = %d\n", i, polarities[i]);