diff mbox series

[1/9] media: atomisp: Drop MRFLD_PORT_NUM define

Message ID 20230518153733.195306-2-hdegoede@redhat.com (mailing list archive)
State New, archived
Headers show
Series media: atomisp: Add support for v4l2-async sensor registration | expand

Commit Message

Hans de Goede May 18, 2023, 3:37 p.m. UTC
The info in the MRFLD_PORT_NUM define is duplicate with
the ATOMISP_CAMERA_NR_PORTS define. Drop MRFLD_PORT_NUM.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/staging/media/atomisp/pci/atomisp-regs.h | 1 -
 drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 8 ++++----
 2 files changed, 4 insertions(+), 5 deletions(-)

Comments

Andy Shevchenko May 18, 2023, 4:05 p.m. UTC | #1
On Thu, May 18, 2023 at 6:37 PM Hans de Goede <hdegoede@redhat.com> wrote:
>
> The info in the MRFLD_PORT_NUM define is duplicate with
> the ATOMISP_CAMERA_NR_PORTS define. Drop MRFLD_PORT_NUM.

JFYI: Since the long term plan of mine is to eventually do something
useful on Intel MID platforms, I would like to keep the Merrifield
(Tangier) / Moorefield (Annidale) support in this driver. That said,
this patch doesn't do any harm to that, so I'm happy.

...

> -       u8 sensor_lanes[MRFLD_PORT_NUM] = { 0 };
> +       u8 sensor_lanes[ATOMISP_CAMERA_NR_PORTS] = { 0 };

You may drop 0 as well.
diff mbox series

Patch

diff --git a/drivers/staging/media/atomisp/pci/atomisp-regs.h b/drivers/staging/media/atomisp/pci/atomisp-regs.h
index 022997f47121..a7b0196686be 100644
--- a/drivers/staging/media/atomisp/pci/atomisp-regs.h
+++ b/drivers/staging/media/atomisp/pci/atomisp-regs.h
@@ -112,7 +112,6 @@ 
 
 /* MRFLD CSI lane configuration related */
 #define MRFLD_PORT_CONFIG_NUM  8
-#define MRFLD_PORT_NUM         3
 #define MRFLD_PORT1_ENABLE_SHIFT       0
 #define MRFLD_PORT2_ENABLE_SHIFT       1
 #define MRFLD_PORT3_ENABLE_SHIFT       2
diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
index a76b60f8b411..93998fdc836d 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
@@ -701,7 +701,7 @@  int atomisp_csi_lane_config(struct atomisp_device *isp)
 	struct pci_dev *pdev = to_pci_dev(isp->dev);
 	static const struct {
 		u8 code;
-		u8 lanes[MRFLD_PORT_NUM];
+		u8 lanes[ATOMISP_CAMERA_NR_PORTS];
 	} portconfigs[] = {
 		/* Tangier/Merrifield available lane configurations */
 		{ 0x00, { 4, 1, 0 } },		/* 00000 */
@@ -725,7 +725,7 @@  int atomisp_csi_lane_config(struct atomisp_device *isp)
 	};
 
 	unsigned int i, j;
-	u8 sensor_lanes[MRFLD_PORT_NUM] = { 0 };
+	u8 sensor_lanes[ATOMISP_CAMERA_NR_PORTS] = { 0 };
 	u32 csi_control;
 	int nportconfigs;
 	u32 port_config_mask;
@@ -782,12 +782,12 @@  int atomisp_csi_lane_config(struct atomisp_device *isp)
 	}
 
 	for (i = 0; i < nportconfigs; i++) {
-		for (j = 0; j < MRFLD_PORT_NUM; j++)
+		for (j = 0; j < ATOMISP_CAMERA_NR_PORTS; j++)
 			if (sensor_lanes[j] &&
 			    sensor_lanes[j] != portconfigs[i].lanes[j])
 				break;
 
-		if (j == MRFLD_PORT_NUM)
+		if (j == ATOMISP_CAMERA_NR_PORTS)
 			break;			/* Found matching setting */
 	}