From: Benjamin Mugnier Date: Wed, 1 Feb 2023 14:04:17 +0000 (+0100) Subject: media: i2c: st-vgxy61: Use VGXY61_NB_POLARITIES instead of hardcoded value in tx_from_ep X-Git-Tag: v6.6.17~5047^2~403 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c2402afcd338b61a7626968a5e9728594459a5de;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/i2c/st-vgxy61.c b/drivers/media/i2c/st-vgxy61.c index 76db976..adbd093 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]);