Skip to contentSkip to conversation

media: imx: imx7_mipi_csis: Fix error return code in mipi_csis_async_register()

PATCH In review Wei Yongjun 2 participants 2 messages May 24, 2021 – May 25, 2021

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: imx: imx7_mipi_csis: Fix error return code in mipi_csis_async_register()

Fix to return negative error code -EINVAL from the error handling case instead of 0, as done elsewhere in this function.

Fixes 88fc81388df9 ("media: imx: imx7_mipi_csis: Reject invalid data-lanes settings")
---
 drivers/staging/media/imx/imx7-mipi-csis.c | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/media/imx/imx7-mipi-csis.c +1 -0
index d573f3475d28..9cd3c86fee58 100644
@@ -1175,6 +1175,7 @@ static int mipi_csis_async_register(struct csi_state *state)
 		if (vep.bus.mipi_csi2.data_lanes[i] != i + 1) {
 			dev_err(state->dev,
 				"data lanes reordering is not supported");
+			ret = -EINVAL;
 			goto err_parse;
 		}
 	}
Acked-by on v1 1/1
#1 lore raw

Hi Yongjun,
Thanks for the patch.

Quoted 6 lines · Wei Yongjun

Fix to return negative error code -EINVAL from the error handling case instead of 0, as done elsewhere in this function.

Fixes 88fc81388df9 ("media: imx: imx7_mipi_csis: Reject invalid data-lanes settings")

Looks good to me, thanks.

------
Cheers,
Rui

Quoted 16 lines
---
 drivers/staging/media/imx/imx7-mipi-csis.c | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/media/imx/imx7-mipi-csis.c +1 -0
index d573f3475d28..9cd3c86fee58 100644
@@ -1175,6 +1175,7 @@ static int mipi_csis_async_register(struct csi_state *state)
 		if (vep.bus.mipi_csi2.data_lanes[i] != i + 1) {
 			dev_err(state->dev,
 				"data lanes reordering is not supported");
+			ret = -EINVAL;
 			goto err_parse;
 		}
 	}