From patchwork Wed Feb 1 14:04:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Mugnier X-Patchwork-Id: 13124378 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C675C636CD for ; Wed, 1 Feb 2023 14:05:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231854AbjBAOFr (ORCPT ); Wed, 1 Feb 2023 09:05:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231594AbjBAOFq (ORCPT ); Wed, 1 Feb 2023 09:05:46 -0500 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D08E193E7 for ; Wed, 1 Feb 2023 06:05:45 -0800 (PST) Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 311BGR6w015669; Wed, 1 Feb 2023 15:05:36 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=/ueCzwUrbTZtoGRhfT5itkPJmanimT3T+EK59ps9zKk=; b=G/45a9T6mGE3+yKrcZfH6bMFcAT86J76YmuQW64Vpd/9RcXviLBhHQu9mrJCRQacYaCf pmXqkEOGKI3WCdH+E5lk2zjCL8f+zCvU/rcURPzd35C+v8df3ATDMz2r55McB/8dfDtz GmVa4NUhjnv1oZrcExE5AqUJb3QCmi662YtCs2DUHmEM0TjLSC7U5x0aeJnbaAyoxRIT bpVWf9M4rTzYtjNnRqVtYsGYTxdZ0esZDFgvdQ6CovJvWcPywya7RjySk3UrgRNcgP2f hiTeLvd9FxRfvL3A6V2gi3krbHQfgbR3h6nGr+OiAKprw5wO9alsGfGVtIc7n6Zgxzi1 aQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3nfq2d0xg0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 01 Feb 2023 15:05:36 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 5C4C510002A; Wed, 1 Feb 2023 15:05:36 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 54B1B21ADC0; Wed, 1 Feb 2023 15:05:36 +0100 (CET) Received: from localhost (10.252.0.107) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.13; Wed, 1 Feb 2023 15:05:36 +0100 From: Benjamin Mugnier To: CC: , , , , Benjamin Mugnier Subject: [PATCH 1/4] media: i2c: st-vgxy61: Remove duplicate default mode set on probe Date: Wed, 1 Feb 2023 15:04:14 +0100 Message-ID: <20230201140417.89195-2-benjamin.mugnier@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230201140417.89195-1-benjamin.mugnier@foss.st.com> References: <20230201140417.89195-1-benjamin.mugnier@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.252.0.107] X-ClientProxiedBy: EQNCAS1NODE4.st.com (10.75.129.82) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-01_04,2023-01-31_01,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org At this stage the default mode is unknown. This is done correctly by vgxy61_fill_framefmt right after. Signed-off-by: Benjamin Mugnier --- drivers/media/i2c/st-vgxy61.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/i2c/st-vgxy61.c b/drivers/media/i2c/st-vgxy61.c index 826baf4e064d..df5483f14560 100644 --- a/drivers/media/i2c/st-vgxy61.c +++ b/drivers/media/i2c/st-vgxy61.c @@ -1332,7 +1332,6 @@ static int vgxy61_init_cfg(struct v4l2_subdev *sd, struct vgxy61_dev *sensor = to_vgxy61_dev(sd); struct v4l2_subdev_format fmt = { 0 }; - sensor->current_mode = sensor->default_mode; vgxy61_fill_framefmt(sensor, sensor->current_mode, &fmt.format, VGXY61_MEDIA_BUS_FMT_DEF); From patchwork Wed Feb 1 14:04:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Mugnier X-Patchwork-Id: 13124379 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 063DDC636CD for ; Wed, 1 Feb 2023 14:06:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231664AbjBAOGy (ORCPT ); Wed, 1 Feb 2023 09:06:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231630AbjBAOGx (ORCPT ); Wed, 1 Feb 2023 09:06:53 -0500 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59BBE133 for ; Wed, 1 Feb 2023 06:06:52 -0800 (PST) Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 311BG7X9014405; Wed, 1 Feb 2023 15:06:43 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=LUWhjaLT9gmGb12ddf0ys+vIyeyFvFSmFIflDj7NUuc=; b=C7hZXP3Ye7YFdSruZGTFf2HnvL81TEk/JkFT36ziqxDy7LTfde86T2TooFZjq20SK1vC m4UDgaQXDynjaNP40VFvG78kuF+58TQy225fDXBoIp2RXDcmgkb8QvDSzoYVHede1xQB zmxDN+vu5JxODzZmlw0HwPP0MTRrRwx9DksJyTFZ3Gx5zho7AqOd6mTbaU/d5mPas7fk Jjvh/7+1zXXbvxUgeNi8QeEuXVZbKGQ0Gg7L4xRS7QPifetLNc+OTOrF3KYErTLmY3KB wnKMg4s/KFlfkROhH8NIbyO4Eel8lSyZTcJwf5KkjWK36yhdm10r6lqJ4etPfTAV3MEc aQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3nfq2d0xq7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 01 Feb 2023 15:06:43 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 1DDD9100038; Wed, 1 Feb 2023 15:06:43 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 17B4D21ED5C; Wed, 1 Feb 2023 15:06:43 +0100 (CET) Received: from localhost (10.252.0.107) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.13; Wed, 1 Feb 2023 15:06:42 +0100 From: Benjamin Mugnier To: CC: , , , , Benjamin Mugnier Subject: [PATCH 2/4] media: i2c: st-vgxy61: Move 'detect' call to 'power_on' Date: Wed, 1 Feb 2023 15:04:15 +0100 Message-ID: <20230201140417.89195-3-benjamin.mugnier@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230201140417.89195-1-benjamin.mugnier@foss.st.com> References: <20230201140417.89195-1-benjamin.mugnier@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.252.0.107] X-ClientProxiedBy: EQNCAS1NODE4.st.com (10.75.129.82) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-01_04,2023-01-31_01,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Previously the device detection was performed after patching. Move it right after the reset to make sure we have the correct sensor before trying to patch it. Signed-off-by: Benjamin Mugnier --- drivers/media/i2c/st-vgxy61.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/i2c/st-vgxy61.c b/drivers/media/i2c/st-vgxy61.c index df5483f14560..e51234aebb16 100644 --- a/drivers/media/i2c/st-vgxy61.c +++ b/drivers/media/i2c/st-vgxy61.c @@ -1732,6 +1732,12 @@ static int vgxy61_power_on(struct device *dev) } } + ret = vgxy61_detect(sensor); + if (ret) { + dev_err(&client->dev, "sensor detect failed %d\n", ret); + goto disable_clock; + } + ret = vgxy61_patch(sensor); if (ret) { dev_err(&client->dev, "sensor patch failed %d\n", ret); @@ -1858,12 +1864,6 @@ static int vgxy61_probe(struct i2c_client *client) if (ret) return ret; - ret = vgxy61_detect(sensor); - if (ret) { - dev_err(&client->dev, "sensor detect failed %d\n", ret); - return ret; - } - vgxy61_fill_sensor_param(sensor); vgxy61_fill_framefmt(sensor, sensor->current_mode, &sensor->fmt, VGXY61_MEDIA_BUS_FMT_DEF); From patchwork Wed Feb 1 14:04:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Mugnier X-Patchwork-Id: 13124380 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0ADCC05027 for ; Wed, 1 Feb 2023 14:08:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231921AbjBAOIA (ORCPT ); Wed, 1 Feb 2023 09:08:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230261AbjBAOH7 (ORCPT ); Wed, 1 Feb 2023 09:07:59 -0500 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB9FF4491 for ; Wed, 1 Feb 2023 06:07:57 -0800 (PST) Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 311A0wos027540; Wed, 1 Feb 2023 15:07:47 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=crd94H66aCetGRnD+HyS9R8AfwddIFLkwQ3BPMOPvEQ=; b=wAsxJ0IOyRLCOfsd5V5Rs4wk2fmsjA+0M6Uy2wai2jhh/hSctJu3Ec+ibtEq90TOnyuV Z80RcPq4hW/S6oaqdjx4oBBQPJIdWRgA78HepY0bayIskN0NrM+Jhowt5YFgeMAPjUIT pq7qVexMbcMjtgAA9Fy8f7wGQ179s+tdqK2baOhNbBk/qvOXbYUuBu3CUEBzJ0K6r50F EfYj+GzU2iMIhmchQR+TeR8CZ3uoTLPQ+vt4+hRPHHO/UJ6qXU7WwCYCO1dgjd/EYjte VmlCRSdDOQ3xWPVvlf1nvGNZOQC2Fzpnf1mHJxj0mDvwSOUAiP0CeRHBxLpOwHwXTLo8 JA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3nfny51efv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 01 Feb 2023 15:07:47 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 629A310002A; Wed, 1 Feb 2023 15:07:47 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 5C99921ED5B; Wed, 1 Feb 2023 15:07:47 +0100 (CET) Received: from localhost (10.252.0.107) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.13; Wed, 1 Feb 2023 15:07:47 +0100 From: Benjamin Mugnier To: CC: , , , , Benjamin Mugnier Subject: [PATCH 3/4] media: i2c: st-vgxy61: Fix control flow error on probe Date: Wed, 1 Feb 2023 15:04:16 +0100 Message-ID: <20230201140417.89195-4-benjamin.mugnier@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230201140417.89195-1-benjamin.mugnier@foss.st.com> References: <20230201140417.89195-1-benjamin.mugnier@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.252.0.107] X-ClientProxiedBy: EQNCAS1NODE4.st.com (10.75.129.82) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-01_04,2023-01-31_01,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org In case of error 'update_hdr' now goes through 'power_off' instead of returning, effectively shutting down the sensor. Signed-off-by: Benjamin Mugnier --- drivers/media/i2c/st-vgxy61.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/st-vgxy61.c b/drivers/media/i2c/st-vgxy61.c index e51234aebb16..2988ba60be94 100644 --- a/drivers/media/i2c/st-vgxy61.c +++ b/drivers/media/i2c/st-vgxy61.c @@ -1868,11 +1868,11 @@ static int vgxy61_probe(struct i2c_client *client) vgxy61_fill_framefmt(sensor, sensor->current_mode, &sensor->fmt, VGXY61_MEDIA_BUS_FMT_DEF); + mutex_init(&sensor->lock); + ret = vgxy61_update_hdr(sensor, sensor->hdr); if (ret) - return ret; - - mutex_init(&sensor->lock); + goto error_power_off; ret = vgxy61_init_controls(sensor); if (ret) { @@ -1911,8 +1911,8 @@ static int vgxy61_probe(struct i2c_client *client) media_entity_cleanup(&sensor->sd.entity); error_handler_free: v4l2_ctrl_handler_free(sensor->sd.ctrl_handler); - mutex_destroy(&sensor->lock); error_power_off: + mutex_destroy(&sensor->lock); vgxy61_power_off(dev); return ret; From patchwork Wed Feb 1 14:04:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Mugnier X-Patchwork-Id: 13124392 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BE6AC636D3 for ; Wed, 1 Feb 2023 14:08:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232154AbjBAOI6 (ORCPT ); Wed, 1 Feb 2023 09:08:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232110AbjBAOI5 (ORCPT ); Wed, 1 Feb 2023 09:08:57 -0500 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D5C85B5B7 for ; Wed, 1 Feb 2023 06:08:56 -0800 (PST) Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 311BGLn9014994; Wed, 1 Feb 2023 15:08:48 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=bB2ZFryYdXmjA3QU26KIfacyh2vp4Fg50keWaR/xbYg=; b=D6i4Im4n/lJHUPGHHuOZaq83NyuOxYDoS3FUZt8pXRslIryjHFeLiidbSTjk08OFyYpa 03VS5oDOqPQYx6JM8T15e1hELfEJxkhqEdgCio/73YZoXFAeSYj07MuttHVFB6Ns/5SW 27S7EoQY3cO3O4K/k8K2XaG1S7BkArUr2GkiXevfK9dRnitoTKc01E0EZi7T+QPhTsvj hYGxZtJzJRpbI1lOcx4OM46+Fjjq+IyNJIvbRcEsudbnkyeE5JxgUFcUd3f9HvtR5L/h YR372iSMfmKHr2Py7GI7YWYA9REqErrvXc2T1fUJ2TLm/lgJrj2Ys2sHmr118XSFhSfx uA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3nfq2d0y7b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 01 Feb 2023 15:08:48 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id C42F210002A; Wed, 1 Feb 2023 15:08:47 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id BE37C21F0A7; Wed, 1 Feb 2023 15:08:47 +0100 (CET) Received: from localhost (10.252.0.107) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.13; Wed, 1 Feb 2023 15:08:47 +0100 From: Benjamin Mugnier To: CC: , , , , Benjamin Mugnier Subject: [PATCH 4/4] media: i2c: st-vgxy61: Use VGXY61_NB_POLARITIES instead of hardcoded value in tx_from_ep Date: Wed, 1 Feb 2023 15:04:17 +0100 Message-ID: <20230201140417.89195-5-benjamin.mugnier@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230201140417.89195-1-benjamin.mugnier@foss.st.com> References: <20230201140417.89195-1-benjamin.mugnier@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.252.0.107] X-ClientProxiedBy: EQNCAS1NODE4.st.com (10.75.129.82) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-01_04,2023-01-31_01,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Signed-off-by: Benjamin Mugnier --- drivers/media/i2c/st-vgxy61.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/st-vgxy61.c b/drivers/media/i2c/st-vgxy61.c index 2988ba60be94..33ff2cf20fbf 100644 --- a/drivers/media/i2c/st-vgxy61.c +++ b/drivers/media/i2c/st-vgxy61.c @@ -1546,7 +1546,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]);