Re: [PATCH 02/13] media: i2c: imx214: Remove unneeded goto
From: Ricardo Ribalda Delgado
Date: Thu Sep 12 2024 - 09:43:58 EST
Hi Andre
On Mon, Sep 2, 2024 at 11:53 PM André Apitzsch via B4 Relay
<devnull+git.apitzsch.eu@xxxxxxxxxx> wrote:
>
> From: André Apitzsch <git@xxxxxxxxxxx>
>
> Simplify the imx214_start_streaming() by removing unneeded goto
> statements, and the corresponding error label.
Could you squash this patch with the previous one?
Thanks!
>
> Signed-off-by: André Apitzsch <git@xxxxxxxxxxx>
> ---
> drivers/media/i2c/imx214.c | 13 ++++---------
> 1 file changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/media/i2c/imx214.c b/drivers/media/i2c/imx214.c
> index 58f3c3f67e0d..283d4783c22e 100644
> --- a/drivers/media/i2c/imx214.c
> +++ b/drivers/media/i2c/imx214.c
> @@ -776,7 +776,7 @@ static int imx214_start_streaming(struct imx214 *imx214)
> ret = imx214_write_table(imx214, mode_table_common);
> if (ret < 0) {
> dev_err(imx214->dev, "could not sent common table %d\n", ret);
> - goto error;
> + return ret;
> }
>
> mode = v4l2_find_nearest_size(imx214_modes,
> @@ -785,22 +785,17 @@ static int imx214_start_streaming(struct imx214 *imx214)
> ret = imx214_write_table(imx214, mode->reg_table);
> if (ret < 0) {
> dev_err(imx214->dev, "could not sent mode table %d\n", ret);
> - goto error;
> + return ret;
> }
> ret = __v4l2_ctrl_handler_setup(&imx214->ctrls);
> if (ret < 0) {
> dev_err(imx214->dev, "could not sync v4l2 controls\n");
> - goto error;
> + return ret;
> }
> ret = regmap_write(imx214->regmap, IMX214_REG_MODE_SELECT, IMX214_MODE_STREAMING);
> - if (ret < 0) {
> + if (ret < 0)
> dev_err(imx214->dev, "could not sent start table %d\n", ret);
> - goto error;
> - }
> -
> - return 0;
>
> -error:
> return ret;
> }
>
>
> --
> 2.46.0
>
>