Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>

authored by

Umang Jain and committed by
Mauro Carvalho Chehab
dbdc7237 1ad03764

+11 -14
+11 -14
drivers/staging/media/ipu3/ipu3.c
··· 440 440 return r; 441 441 } 442 442 443 + static void imgu_video_nodes_exit(struct imgu_device *imgu) 444 + { 445 + int i; 446 + 447 + for (i = 0; i < IMGU_MAX_PIPE_NUM; i++) 448 + imgu_dummybufs_cleanup(imgu, i); 449 + 450 + imgu_v4l2_unregister(imgu); 451 + } 452 + 443 453 static int imgu_video_nodes_init(struct imgu_device *imgu) 444 454 { 445 455 struct v4l2_pix_format_mplane *fmts[IPU3_CSS_QUEUES] = { NULL }; ··· 499 489 return 0; 500 490 501 491 out_cleanup: 502 - for (j = 0; j < IMGU_MAX_PIPE_NUM; j++) 503 - imgu_dummybufs_cleanup(imgu, j); 504 - 505 - imgu_v4l2_unregister(imgu); 492 + imgu_video_nodes_exit(imgu); 506 493 507 494 return r; 508 - } 509 - 510 - static void imgu_video_nodes_exit(struct imgu_device *imgu) 511 - { 512 - int i; 513 - 514 - for (i = 0; i < IMGU_MAX_PIPE_NUM; i++) 515 - imgu_dummybufs_cleanup(imgu, i); 516 - 517 - imgu_v4l2_unregister(imgu); 518 495 } 519 496 520 497 /**************** PCI interface ****************/