mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lad Prabhakar <prabhakar.csengg@gmail.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: LMML <linux-media@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"Lad, Prabhakar" <prabhakar.csengg@gmail.com>
Subject: [PATCH 3/3] media: omap3isp: ispvideo: use vb2_fop_mmap/poll
Date: Mon, 23 Feb 2015 20:19:33 +0000	[thread overview]
Message-ID: <1424722773-20131-4-git-send-email-prabhakar.csengg@gmail.com> (raw)
In-Reply-To: <1424722773-20131-1-git-send-email-prabhakar.csengg@gmail.com>

From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>

No need to reinvent the wheel. Just use the already existing
functions provided v4l-core.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
---
 drivers/media/platform/omap3isp/ispvideo.c | 30 ++++--------------------------
 1 file changed, 4 insertions(+), 26 deletions(-)

diff --git a/drivers/media/platform/omap3isp/ispvideo.c b/drivers/media/platform/omap3isp/ispvideo.c
index b648176..5dd5ffc 100644
--- a/drivers/media/platform/omap3isp/ispvideo.c
+++ b/drivers/media/platform/omap3isp/ispvideo.c
@@ -1277,37 +1277,13 @@ static int isp_video_release(struct file *file)
 	return ret;
 }
 
-static unsigned int isp_video_poll(struct file *file, poll_table *wait)
-{
-	struct isp_video *video = video_drvdata(file);
-	int ret;
-
-	mutex_lock(&video->queue_lock);
-	ret = vb2_poll(&video->queue, file, wait);
-	mutex_unlock(&video->queue_lock);
-
-	return ret;
-}
-
-static int isp_video_mmap(struct file *file, struct vm_area_struct *vma)
-{
-	struct isp_video *video = video_drvdata(file);
-	int ret;
-
-	mutex_lock(&video->queue_lock);
-	ret = vb2_mmap(&video->queue, vma);
-	mutex_unlock(&video->queue_lock);
-
-	return ret;
-}
-
 static struct v4l2_file_operations isp_video_fops = {
 	.owner = THIS_MODULE,
 	.unlocked_ioctl = video_ioctl2,
 	.open = isp_video_open,
 	.release = isp_video_release,
-	.poll = isp_video_poll,
-	.mmap = isp_video_mmap,
+	.poll = vb2_fop_poll,
+	.mmap = vb2_fop_mmap,
 };
 
 /* -----------------------------------------------------------------------------
@@ -1389,6 +1365,8 @@ int omap3isp_video_register(struct isp_video *video, struct v4l2_device *vdev)
 
 	video->video.v4l2_dev = vdev;
 
+	/* queue isnt initalized */
+	video->video.queue = &video->queue;
 	ret = video_register_device(&video->video, VFL_TYPE_GRABBER, -1);
 	if (ret < 0)
 		dev_err(video->isp->dev,
-- 
2.1.0


  parent reply	other threads:[~2015-02-23 20:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-23 20:19 [PATCH 0/3] omap3isp trivial enhancements Lad Prabhakar
2015-02-23 20:19 ` [PATCH 1/3] media: omap3isp: ispvideo: drop setting of vb2 buffer state to VB2_BUF_STATE_ACTIVE Lad Prabhakar
2015-02-24  0:12   ` Laurent Pinchart
2015-02-23 20:19 ` [PATCH 2/3] media: omap3isp: ispvideo: drop driver specific isp_video_fh Lad Prabhakar
2015-02-24  0:35   ` Laurent Pinchart
2015-02-24  8:04     ` Lad, Prabhakar
2015-02-24  9:07       ` Laurent Pinchart
2015-02-23 20:19 ` Lad Prabhakar [this message]
2015-02-24  0:23   ` [PATCH 3/3] media: omap3isp: ispvideo: use vb2_fop_mmap/poll Laurent Pinchart
2015-02-24  7:54     ` Lad, Prabhakar
2015-03-08 20:19     ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1424722773-20131-4-git-send-email-prabhakar.csengg@gmail.com \
    --to=prabhakar.csengg@gmail.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome