{"id":15868,"url":"https://patchwork.libcamera.org/api/1.1/patches/15868/?format=json","web_url":"https://patchwork.libcamera.org/patch/15868/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20220510115147.19360-29-laurent.pinchart@ideasonboard.com>","date":"2022-05-10T11:51:25","name":"[libcamera-devel,28/50] staging: media: imx: imx7-media-csi: Fold imx_media_video_dev into imx7_csi","commit_ref":null,"pull_url":null,"state":"not-applicable","archived":false,"hash":"14f169d5e51ca548cf588800f7fd80ec4363e078","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/15868/mbox/","series":[{"id":3106,"url":"https://patchwork.libcamera.org/api/1.1/series/3106/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3106","date":"2022-05-10T11:50:57","name":"staging: media: imx: Prepare destaging of imx7-media-csi","version":1,"mbox":"https://patchwork.libcamera.org/series/3106/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/15868/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/15868/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 5F88DC0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 10 May 2022 11:52:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0216865674;\n\tTue, 10 May 2022 13:52:30 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EA81565681\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 10 May 2022 13:52:20 +0200 (CEST)","from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1F68F824;\n\tTue, 10 May 2022 13:52:20 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652183550;\n\tbh=dOIuG8WAkRVjS+sir4i0rbt/c2SmHOREKpWNSEMUE7c=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=v04NagGaRl6AWjuinniFfcsulGvgMdhiJjLjGykd6NOuJyBHMrQ66zMW+kzH36sdy\n\tTKKqEILfRTq7EleAVj9LDlwXsBf7zhMGq0Z9/Ep4y5RqeO3lNqEfE2xOLgtkr0EBKW\n\t8uc8ydE7cHT+o3gqPynY/jio7fuQ6eFykDWuf6SF7ROgMQp1Xud/ouDaH4jsWALiXD\n\tQKC+pTGR+pxH8vqEQI4jjT96rnPn+0ob+y4aF84iVrVi0xGYlILf9UfZ49ViD7Et8n\n\tv2TYHJeqjHatwBTpPfAzOzurujvwNFqhVjjzUD1SY8zJwffKwluRQ0OY+rzWytvo79\n\txyIn+wE07C3Yw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652183540;\n\tbh=dOIuG8WAkRVjS+sir4i0rbt/c2SmHOREKpWNSEMUE7c=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=oTNURRoSA+n9khUkjQIWmEhoAUIdWm9ckh5iKcqA4EKMiZfL3TBRkeFjPNbrTOdcJ\n\tEwdAhiVe75GHulJUMwrnokAm4h9hz9Jse8FUc+Tz3YSZUDFYukpONpZ03vlE5uZbRQ\n\tquR358hbpsnnf3MjO1qzazD9HMIhpgBuJKVY8C4U="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"oTNURRoS\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 10 May 2022 14:51:25 +0300","Message-Id":"<20220510115147.19360-29-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.35.1","In-Reply-To":"<20220510115147.19360-1-laurent.pinchart@ideasonboard.com>","References":"<20220510115147.19360-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 28/50] staging: media: imx:\n\timx7-media-csi: Fold imx_media_video_dev into imx7_csi","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"Martin Kepplinger <martin.kepplinger@puri.sm>, kernel@pengutronix.de,\n\tDorota Czaplejewicz <dorota.czaplejewicz@puri.sm>,\n\tAlexander Stein <alexander.stein@ew.tq-group.com>,\n\tRui Miguel Silva <rmfrfs@gmail.com>,\n\tPhilipp Zabel <p.zabel@pengutronix.de>, \n\tSteve Longerbeam <slongerbeam@gmail.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Now that the driver doesn't use any helper that relies on the\nimx_media_video_dev structure anymore, merge its fields directly in the\nimx7_csi structure. Update all the users accordingly, and drop the list\nfield that isn't used by the driver.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n drivers/staging/media/imx/imx7-media-csi.c | 121 ++++++++++-----------\n 1 file changed, 57 insertions(+), 64 deletions(-)","diff":"diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c\nindex bd1bc3fada2e..14683a15e003 100644\n--- a/drivers/staging/media/imx/imx7-media-csi.c\n+++ b/drivers/staging/media/imx/imx7-media-csi.c\n@@ -212,9 +212,13 @@ struct imx7_csi {\n \tconst struct imx_media_pixfmt *cc[IMX7_CSI_PADS_NUM];\n \n \t/* Video device */\n-\tstruct imx_media_video_dev vdev;\t/* Video device */\n+\tstruct video_device *vdev;\t\t/* Video device */\n \tstruct media_pad vdev_pad;\t\t/* Video device pad */\n \n+\tstruct v4l2_pix_format vdev_fmt;\t/* The user format */\n+\tconst struct imx_media_pixfmt *vdev_cc;\n+\tstruct v4l2_rect vdev_compose;\t\t/* The compose rectangle */\n+\n \tstruct mutex vdev_mutex;\t\t/* Protect vdev operations */\n \n \tstruct vb2_queue q;\t\t\t/* The videobuf2 queue */\n@@ -413,11 +417,10 @@ static void imx7_csi_dma_unsetup_vb2_buf(struct imx7_csi *csi,\n \n static int imx7_csi_dma_setup(struct imx7_csi *csi)\n {\n-\tstruct imx_media_video_dev *vdev = &csi->vdev;\n \tint ret;\n \n \tret = imx_media_alloc_dma_buf(csi->dev, &csi->underrun_buf,\n-\t\t\t\t      vdev->fmt.sizeimage);\n+\t\t\t\t      csi->vdev_fmt.sizeimage);\n \tif (ret < 0) {\n \t\tv4l2_warn(&csi->sd, \"consider increasing the CMA area\\n\");\n \t\treturn ret;\n@@ -464,8 +467,7 @@ static void imx7_csi_dma_stop(struct imx7_csi *csi)\n \n static void imx7_csi_configure(struct imx7_csi *csi)\n {\n-\tstruct imx_media_video_dev *vdev = &csi->vdev;\n-\tstruct v4l2_pix_format *out_pix = &vdev->fmt;\n+\tstruct v4l2_pix_format *out_pix = &csi->vdev_fmt;\n \tint width = out_pix->width;\n \tu32 stride = 0;\n \tu32 cr3 = BIT_FRMCNT_RST;\n@@ -664,14 +666,13 @@ static void imx7_csi_error_recovery(struct imx7_csi *csi)\n \n static void imx7_csi_vb2_buf_done(struct imx7_csi *csi)\n {\n-\tstruct imx_media_video_dev *vdev = &csi->vdev;\n \tstruct imx7_csi_vb2_buffer *done, *next;\n \tstruct vb2_buffer *vb;\n \tdma_addr_t phys;\n \n \tdone = csi->active_vb2_buf[csi->buf_num];\n \tif (done) {\n-\t\tdone->vbuf.field = vdev->fmt.field;\n+\t\tdone->vbuf.field = csi->vdev_fmt.field;\n \t\tdone->vbuf.sequence = csi->frame_sequence;\n \t\tvb = &done->vbuf.vb2_buf;\n \t\tvb->timestamp = ktime_get_ns();\n@@ -829,7 +830,7 @@ static int imx7_csi_video_g_fmt_vid_cap(struct file *file, void *fh,\n {\n \tstruct imx7_csi *csi = video_drvdata(file);\n \n-\tf->fmt.pix = csi->vdev.fmt;\n+\tf->fmt.pix = csi->vdev_fmt;\n \n \treturn 0;\n }\n@@ -896,10 +897,10 @@ static int imx7_csi_video_s_fmt_vid_cap(struct file *file, void *fh,\n \t\treturn -EBUSY;\n \t}\n \n-\tcc = __imx7_csi_video_try_fmt(&f->fmt.pix, &csi->vdev.compose);\n+\tcc = __imx7_csi_video_try_fmt(&f->fmt.pix, &csi->vdev_compose);\n \n-\tcsi->vdev.cc = cc;\n-\tcsi->vdev.fmt = f->fmt.pix;\n+\tcsi->vdev_cc = cc;\n+\tcsi->vdev_fmt = f->fmt.pix;\n \n \treturn 0;\n }\n@@ -914,7 +915,7 @@ static int imx7_csi_video_g_selection(struct file *file, void *fh,\n \tcase V4L2_SEL_TGT_COMPOSE_DEFAULT:\n \tcase V4L2_SEL_TGT_COMPOSE_BOUNDS:\n \t\t/* The compose rectangle is fixed to the source format. */\n-\t\ts->r = csi->vdev.compose;\n+\t\ts->r = csi->vdev_compose;\n \t\tbreak;\n \tcase V4L2_SEL_TGT_COMPOSE_PADDED:\n \t\t/*\n@@ -924,8 +925,8 @@ static int imx7_csi_video_g_selection(struct file *file, void *fh,\n \t\t */\n \t\ts->r.left = 0;\n \t\ts->r.top = 0;\n-\t\ts->r.width = csi->vdev.fmt.width;\n-\t\ts->r.height = csi->vdev.fmt.height;\n+\t\ts->r.width = csi->vdev_fmt.width;\n+\t\ts->r.height = csi->vdev_fmt.height;\n \t\tbreak;\n \tdefault:\n \t\treturn -EINVAL;\n@@ -982,7 +983,7 @@ static int imx7_csi_video_queue_setup(struct vb2_queue *vq,\n \t\t\t\t      struct device *alloc_devs[])\n {\n \tstruct imx7_csi *csi = vb2_get_drv_priv(vq);\n-\tstruct v4l2_pix_format *pix = &csi->vdev.fmt;\n+\tstruct v4l2_pix_format *pix = &csi->vdev_fmt;\n \tunsigned int count = *nbuffers;\n \n \tif (vq->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)\n@@ -1020,7 +1021,7 @@ static int imx7_csi_video_buf_init(struct vb2_buffer *vb)\n static int imx7_csi_video_buf_prepare(struct vb2_buffer *vb)\n {\n \tstruct imx7_csi *csi = vb2_get_drv_priv(vb->vb2_queue);\n-\tstruct v4l2_pix_format *pix = &csi->vdev.fmt;\n+\tstruct v4l2_pix_format *pix = &csi->vdev_fmt;\n \n \tif (vb2_plane_size(vb, 0) < pix->sizeimage) {\n \t\tdev_err(csi->dev,\n@@ -1063,12 +1064,12 @@ static int imx7_csi_video_validate_fmt(struct imx7_csi *csi)\n \t/*\n \t * Verify that the media bus size matches the size set on the video\n \t * node. It is sufficient to check the compose rectangle size without\n-\t * checking the rounded size from vdev.fmt, as the rounded size is\n+\t * checking the rounded size from pix_fmt, as the rounded size is\n \t * derived directly from the compose rectangle size, and will thus\n \t * always match if the compose rectangle matches.\n \t */\n-\tif (csi->vdev.compose.width != fmt_src.format.width ||\n-\t    csi->vdev.compose.height != fmt_src.format.height)\n+\tif (csi->vdev_compose.width != fmt_src.format.width ||\n+\t    csi->vdev_compose.height != fmt_src.format.height)\n \t\treturn -EPIPE;\n \n \t/*\n@@ -1076,7 +1077,7 @@ static int imx7_csi_video_validate_fmt(struct imx7_csi *csi)\n \t * set on the video node.\n \t */\n \tcc = imx7_csi_video_find_format(fmt_src.format.code, 0);\n-\tif (!cc || csi->vdev.cc->cs != cc->cs)\n+\tif (!cc || csi->vdev_cc->cs != cc->cs)\n \t\treturn -EPIPE;\n \n \treturn 0;\n@@ -1164,7 +1165,6 @@ static const struct vb2_ops imx7_csi_video_qops = {\n static int imx7_csi_video_open(struct file *file)\n {\n \tstruct imx7_csi *csi = video_drvdata(file);\n-\tstruct video_device *vfd = csi->vdev.vfd;\n \tint ret;\n \n \tif (mutex_lock_interruptible(&csi->vdev_mutex))\n@@ -1176,7 +1176,7 @@ static int imx7_csi_video_open(struct file *file)\n \t\tgoto out;\n \t}\n \n-\tret = v4l2_pipeline_pm_get(&vfd->entity);\n+\tret = v4l2_pipeline_pm_get(&csi->vdev->entity);\n \tif (ret)\n \t\tv4l2_fh_release(file);\n \n@@ -1188,7 +1188,6 @@ static int imx7_csi_video_open(struct file *file)\n static int imx7_csi_video_release(struct file *file)\n {\n \tstruct imx7_csi *csi = video_drvdata(file);\n-\tstruct video_device *vfd = csi->vdev.vfd;\n \tstruct vb2_queue *vq = &csi->q;\n \n \tmutex_lock(&csi->vdev_mutex);\n@@ -1198,7 +1197,7 @@ static int imx7_csi_video_release(struct file *file)\n \t\tvq->owner = NULL;\n \t}\n \n-\tv4l2_pipeline_pm_put(&vfd->entity);\n+\tv4l2_pipeline_pm_put(&csi->vdev->entity);\n \n \tv4l2_fh_release(file);\n \tmutex_unlock(&csi->vdev_mutex);\n@@ -1243,18 +1242,16 @@ static int imx7_csi_video_init_format(struct imx7_csi *csi)\n \t\t.pad = IMX7_CSI_PAD_SRC,\n \t\t.which = V4L2_SUBDEV_FORMAT_ACTIVE,\n \t};\n-\tstruct imx_media_video_dev *vdev = &csi->vdev;\n-\n \tfmt_src.format.code = MEDIA_BUS_FMT_UYVY8_2X8;\n \tfmt_src.format.width = IMX_MEDIA_DEF_PIX_WIDTH;\n \tfmt_src.format.height = IMX_MEDIA_DEF_PIX_HEIGHT;\n \n-\timx_media_mbus_fmt_to_pix_fmt(&vdev->fmt, &fmt_src.format, NULL);\n-\tvdev->compose.width = fmt_src.format.width;\n-\tvdev->compose.height = fmt_src.format.height;\n+\timx_media_mbus_fmt_to_pix_fmt(&csi->vdev_fmt, &fmt_src.format, NULL);\n+\tcsi->vdev_compose.width = fmt_src.format.width;\n+\tcsi->vdev_compose.height = fmt_src.format.height;\n \n-\tvdev->cc = imx_media_find_pixel_format(vdev->fmt.pixelformat,\n-\t\t\t\t\t       PIXFMT_SEL_ANY);\n+\tcsi->vdev_cc = imx_media_find_pixel_format(csi->vdev_fmt.pixelformat,\n+\t\t\t\t\t\t   PIXFMT_SEL_ANY);\n \n \treturn 0;\n }\n@@ -1263,10 +1260,10 @@ static int imx7_csi_video_register(struct imx7_csi *csi)\n {\n \tstruct v4l2_subdev *sd = &csi->sd;\n \tstruct v4l2_device *v4l2_dev = sd->v4l2_dev;\n-\tstruct video_device *vfd = csi->vdev.vfd;\n+\tstruct video_device *vdev = csi->vdev;\n \tint ret;\n \n-\tvfd->v4l2_dev = v4l2_dev;\n+\tvdev->v4l2_dev = v4l2_dev;\n \n \t/* Initialize the default format and compose rectangle. */\n \tret = imx7_csi_video_init_format(csi);\n@@ -1274,22 +1271,22 @@ static int imx7_csi_video_register(struct imx7_csi *csi)\n \t\treturn ret;\n \n \t/* Register the video device. */\n-\tret = video_register_device(vfd, VFL_TYPE_VIDEO, -1);\n+\tret = video_register_device(vdev, VFL_TYPE_VIDEO, -1);\n \tif (ret) {\n \t\tdev_err(csi->dev, \"Failed to register video device\\n\");\n \t\treturn ret;\n \t}\n \n-\tdev_info(csi->dev, \"Registered %s as /dev/%s\\n\", vfd->name,\n-\t\t video_device_node_name(vfd));\n+\tdev_info(csi->dev, \"Registered %s as /dev/%s\\n\", vdev->name,\n+\t\t video_device_node_name(vdev));\n \n \t/* Create the link from the CSI subdev to the video device. */\n-\tret = media_create_pad_link(&sd->entity, IMX7_CSI_PAD_SRC, &vfd->entity,\n-\t\t\t\t    0, MEDIA_LNK_FL_IMMUTABLE |\n+\tret = media_create_pad_link(&sd->entity, IMX7_CSI_PAD_SRC,\n+\t\t\t\t    &vdev->entity, 0, MEDIA_LNK_FL_IMMUTABLE |\n \t\t\t\t    MEDIA_LNK_FL_ENABLED);\n \tif (ret) {\n \t\tdev_err(csi->dev, \"failed to create link to device node\\n\");\n-\t\tvideo_unregister_device(vfd);\n+\t\tvideo_unregister_device(vdev);\n \t\treturn ret;\n \t}\n \n@@ -1298,15 +1295,13 @@ static int imx7_csi_video_register(struct imx7_csi *csi)\n \n static void imx7_csi_video_unregister(struct imx7_csi *csi)\n {\n-\tstruct video_device *vfd = csi->vdev.vfd;\n-\n-\tmedia_entity_cleanup(&vfd->entity);\n-\tvideo_unregister_device(vfd);\n+\tmedia_entity_cleanup(&csi->vdev->entity);\n+\tvideo_unregister_device(csi->vdev);\n }\n \n static int imx7_csi_video_init(struct imx7_csi *csi)\n {\n-\tstruct video_device *vfd;\n+\tstruct video_device *vdev;\n \tstruct vb2_queue *vq;\n \tint ret;\n \n@@ -1315,32 +1310,31 @@ static int imx7_csi_video_init(struct imx7_csi *csi)\n \tspin_lock_init(&csi->q_lock);\n \n \t/* Allocate and initialize the video device. */\n-\tvfd = video_device_alloc();\n-\tif (!vfd)\n+\tvdev = video_device_alloc();\n+\tif (!vdev)\n \t\treturn -ENOMEM;\n \n-\tvfd->fops = &imx7_csi_video_fops;\n-\tvfd->ioctl_ops = &imx7_csi_video_ioctl_ops;\n-\tvfd->minor = -1;\n-\tvfd->release = video_device_release;\n-\tvfd->vfl_dir = VFL_DIR_RX;\n-\tvfd->tvnorms = V4L2_STD_NTSC | V4L2_STD_PAL | V4L2_STD_SECAM;\n-\tvfd->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING\n+\tvdev->fops = &imx7_csi_video_fops;\n+\tvdev->ioctl_ops = &imx7_csi_video_ioctl_ops;\n+\tvdev->minor = -1;\n+\tvdev->release = video_device_release;\n+\tvdev->vfl_dir = VFL_DIR_RX;\n+\tvdev->tvnorms = V4L2_STD_NTSC | V4L2_STD_PAL | V4L2_STD_SECAM;\n+\tvdev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING\n \t\t\t | V4L2_CAP_IO_MC;\n-\tvfd->lock = &csi->vdev_mutex;\n-\tvfd->queue = &csi->q;\n+\tvdev->lock = &csi->vdev_mutex;\n+\tvdev->queue = &csi->q;\n \n-\tsnprintf(vfd->name, sizeof(vfd->name), \"%s capture\", csi->sd.name);\n+\tsnprintf(vdev->name, sizeof(vdev->name), \"%s capture\", csi->sd.name);\n \n-\tvideo_set_drvdata(vfd, csi);\n-\tcsi->vdev.vfd = vfd;\n-\tINIT_LIST_HEAD(&csi->vdev.list);\n+\tvideo_set_drvdata(vdev, csi);\n+\tcsi->vdev = vdev;\n \n \t/* Initialize the video device pad. */\n \tcsi->vdev_pad.flags = MEDIA_PAD_FL_SINK;\n-\tret = media_entity_pads_init(&vfd->entity, 1, &csi->vdev_pad);\n+\tret = media_entity_pads_init(&vdev->entity, 1, &csi->vdev_pad);\n \tif (ret) {\n-\t\tvideo_device_release(vfd);\n+\t\tvideo_device_release(vdev);\n \t\treturn ret;\n \t}\n \n@@ -1360,7 +1354,7 @@ static int imx7_csi_video_init(struct imx7_csi *csi)\n \tret = vb2_queue_init(vq);\n \tif (ret) {\n \t\tdev_err(csi->dev, \"vb2_queue_init failed\\n\");\n-\t\tvideo_device_release(vfd);\n+\t\tvideo_device_release(vdev);\n \t\treturn ret;\n \t}\n \n@@ -1629,8 +1623,7 @@ static int imx7_csi_pad_link_validate(struct v4l2_subdev *sd,\n \t\t\t\t      struct v4l2_subdev_format *sink_fmt)\n {\n \tstruct imx7_csi *csi = v4l2_get_subdevdata(sd);\n-\tstruct imx_media_video_dev *vdev = &csi->vdev;\n-\tconst struct v4l2_pix_format *out_pix = &vdev->fmt;\n+\tconst struct v4l2_pix_format *out_pix = &csi->vdev_fmt;\n \tstruct media_pad *pad = NULL;\n \tunsigned int i;\n \tint ret;\n","prefixes":["libcamera-devel","28/50"]}