Commit f744d9a4 authored by Deepak R Varma's avatar Deepak R Varma Committed by Mauro Carvalho Chehab
Browse files

media: staging/intel-ipu3: Simplify single goto jump



On successful node setup, the code jumps to a cleanup label to perform
nodes cleanup. This only call to cleanup using goto label can be
included in the for / if blocks to make it look more associated.

Signed-off-by: default avatarDeepak R Varma <mh12gx2825@gmail.com>
Reviewed-by: default avatarStefano Brivio <sbrivio@redhat.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent ce7d96a4
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
@@ -1300,20 +1300,18 @@ static void imgu_v4l2_nodes_cleanup_pipe(struct imgu_device *imgu,

static int imgu_v4l2_nodes_setup_pipe(struct imgu_device *imgu, int pipe)
{
	int i, r;
	int i;

	for (i = 0; i < IMGU_NODE_NUM; i++) {
		r = imgu_v4l2_node_setup(imgu, pipe, i);
		if (r)
			goto cleanup;
	}

	return 0;
		int r = imgu_v4l2_node_setup(imgu, pipe, i);

cleanup:
		if (r) {
			imgu_v4l2_nodes_cleanup_pipe(imgu, pipe, i);
			return r;
		}
	}
	return 0;
}

static void imgu_v4l2_subdev_cleanup(struct imgu_device *imgu, unsigned int i)
{