Skip to content

Commit 4596c55

Browse files
Julien MassotHans Verkuil
authored andcommitted
media: i2c: max96714: coding style fixes
Coding style fixes suggested by Sakari during the driver review. Reviewed-by: Tommaso Merciai <tomm.merciai@gmail.com> Tested-by: Tommaso Merciai <tomm.merciai@gmail.com> Signed-off-by: Julien Massot <julien.massot@collabora.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
1 parent 24fe3eb commit 4596c55

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

drivers/media/i2c/max96714.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#define MAX96714_NPORTS 2
2626
#define MAX96714_PAD_SINK 0
2727
#define MAX96714_PAD_SOURCE 1
28+
#define MAX96714_CSI_NLANES 4
2829

2930
/* DEV */
3031
#define MAX96714_REG13 CCI_REG8(0x0d)
@@ -52,9 +53,9 @@
5253
#define MAX96714_PATGEN_V2D CCI_REG24(0x254)
5354
#define MAX96714_PATGEN_DE_HIGH CCI_REG16(0x257)
5455
#define MAX96714_PATGEN_DE_LOW CCI_REG16(0x259)
55-
#define MAX96714_PATGEN_DE_CNT CCI_REG16(0x25B)
56+
#define MAX96714_PATGEN_DE_CNT CCI_REG16(0x25b)
5657
#define MAX96714_PATGEN_GRAD_INC CCI_REG8(0x25d)
57-
#define MAX96714_PATGEN_CHKB_COLOR_A CCI_REG24(0x25E)
58+
#define MAX96714_PATGEN_CHKB_COLOR_A CCI_REG24(0x25e)
5859
#define MAX96714_PATGEN_CHKB_COLOR_B CCI_REG24(0x261)
5960
#define MAX96714_PATGEN_CHKB_RPT_CNT_A CCI_REG8(0x264)
6061
#define MAX96714_PATGEN_CHKB_RPT_CNT_B CCI_REG8(0x265)
@@ -724,8 +725,9 @@ static int max96714_init_tx_port(struct max96714_priv *priv)
724725
* Unused lanes need to be mapped as well to not have
725726
* the same lanes mapped twice.
726727
*/
727-
for (; lane < 4; lane++) {
728-
unsigned int idx = find_first_zero_bit(&lanes_used, 4);
728+
for (; lane < MAX96714_CSI_NLANES; lane++) {
729+
unsigned int idx = find_first_zero_bit(&lanes_used,
730+
MAX96714_CSI_NLANES);
729731

730732
val |= idx << (lane * 2);
731733
lanes_used |= BIT(idx);
@@ -757,9 +759,7 @@ static int max96714_rxport_disable_poc(struct max96714_priv *priv)
757759
static int max96714_parse_dt_txport(struct max96714_priv *priv)
758760
{
759761
struct device *dev = &priv->client->dev;
760-
struct v4l2_fwnode_endpoint vep = {
761-
.bus_type = V4L2_MBUS_CSI2_DPHY
762-
};
762+
struct v4l2_fwnode_endpoint vep = { .bus_type = V4L2_MBUS_CSI2_DPHY };
763763
struct fwnode_handle *ep_fwnode;
764764
u32 num_data_lanes;
765765
int ret;
@@ -791,14 +791,14 @@ static int max96714_parse_dt_txport(struct max96714_priv *priv)
791791
}
792792

793793
num_data_lanes = vep.bus.mipi_csi2.num_data_lanes;
794-
if (num_data_lanes < 1 || num_data_lanes > 4) {
794+
if (num_data_lanes < 1 || num_data_lanes > MAX96714_CSI_NLANES) {
795795
dev_err(dev,
796796
"tx: invalid number of data lanes must be 1 to 4\n");
797797
ret = -EINVAL;
798798
goto err_free_vep;
799799
}
800800

801-
memcpy(&priv->mipi_csi2, &vep.bus.mipi_csi2, sizeof(priv->mipi_csi2));
801+
priv->mipi_csi2 = vep.bus.mipi_csi2;
802802

803803
err_free_vep:
804804
v4l2_fwnode_endpoint_free(&vep);

0 commit comments

Comments
 (0)