From: Umang Jain Date: Fri, 18 Mar 2022 12:18:26 +0000 (+0000) Subject: media: staging/intel-ipu3: Cleanup dummy buffers via helper X-Git-Tag: v5.19-rc1~179^2~254 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dbdc7237ec71316e99c1905264cc00b88e277e57;p=thirdparty%2Fkernel%2Flinux.git media: staging/intel-ipu3: Cleanup dummy buffers via helper Use an existing helper imgu_video_nodes_exit() on imgu-video-node initialization failure path to cleanup dummy buffers. Signed-off-by: Umang Jain Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/staging/media/ipu3/ipu3.c b/drivers/staging/media/ipu3/ipu3.c index 8e1e9e46e6045..0c453b37f8c4b 100644 --- a/drivers/staging/media/ipu3/ipu3.c +++ b/drivers/staging/media/ipu3/ipu3.c @@ -440,6 +440,16 @@ fail_start_streaming: return r; } +static void imgu_video_nodes_exit(struct imgu_device *imgu) +{ + int i; + + for (i = 0; i < IMGU_MAX_PIPE_NUM; i++) + imgu_dummybufs_cleanup(imgu, i); + + imgu_v4l2_unregister(imgu); +} + static int imgu_video_nodes_init(struct imgu_device *imgu) { struct v4l2_pix_format_mplane *fmts[IPU3_CSS_QUEUES] = { NULL }; @@ -489,24 +499,11 @@ static int imgu_video_nodes_init(struct imgu_device *imgu) return 0; out_cleanup: - for (j = 0; j < IMGU_MAX_PIPE_NUM; j++) - imgu_dummybufs_cleanup(imgu, j); - - imgu_v4l2_unregister(imgu); + imgu_video_nodes_exit(imgu); return r; } -static void imgu_video_nodes_exit(struct imgu_device *imgu) -{ - int i; - - for (i = 0; i < IMGU_MAX_PIPE_NUM; i++) - imgu_dummybufs_cleanup(imgu, i); - - imgu_v4l2_unregister(imgu); -} - /**************** PCI interface ****************/ static irqreturn_t imgu_isr_threaded(int irq, void *imgu_ptr)