From: Hans Verkuil <[email protected]>

- zero priv field in pix_format
- fix poll return mask
- correctly fill in bus_info

Signed-off-by: Hans Verkuil <[email protected]>
---
 drivers/media/parport/c-qcam.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/media/parport/c-qcam.c b/drivers/media/parport/c-qcam.c
index ec51e1f..8de8a20 100644
--- a/drivers/media/parport/c-qcam.c
+++ b/drivers/media/parport/c-qcam.c
@@ -518,7 +518,7 @@ static int qcam_querycap(struct file *file, void  *priv,
 
        strlcpy(vcap->driver, qcam->v4l2_dev.name, sizeof(vcap->driver));
        strlcpy(vcap->card, "Color Quickcam", sizeof(vcap->card));
-       strlcpy(vcap->bus_info, "parport", sizeof(vcap->bus_info));
+       strlcpy(vcap->bus_info, qcam->pport->name, sizeof(vcap->bus_info));
        vcap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE;
        vcap->capabilities = vcap->device_caps | V4L2_CAP_DEVICE_CAPS;
        return 0;
@@ -561,6 +561,7 @@ static int qcam_g_fmt_vid_cap(struct file *file, void *fh, 
struct v4l2_format *f
        pix->sizeimage = 3 * qcam->width * qcam->height;
        /* Just a guess */
        pix->colorspace = V4L2_COLORSPACE_SRGB;
+       pix->priv = 0;
        return 0;
 }
 
@@ -584,6 +585,7 @@ static int qcam_try_fmt_vid_cap(struct file *file, void 
*fh, struct v4l2_format
        pix->sizeimage = 3 * pix->width * pix->height;
        /* Just a guess */
        pix->colorspace = V4L2_COLORSPACE_SRGB;
+       pix->priv = 0;
        return 0;
 }
 
@@ -651,6 +653,11 @@ static ssize_t qcam_read(struct file *file, char __user 
*buf,
        return len;
 }
 
+static unsigned int qcam_poll(struct file *filp, poll_table *wait)
+{
+       return v4l2_ctrl_poll(filp, wait) | POLLIN | POLLRDNORM;
+}
+
 static int qcam_s_ctrl(struct v4l2_ctrl *ctrl)
 {
        struct qcam *qcam =
@@ -685,7 +692,7 @@ static const struct v4l2_file_operations qcam_fops = {
        .owner          = THIS_MODULE,
        .open           = v4l2_fh_open,
        .release        = v4l2_fh_release,
-       .poll           = v4l2_ctrl_poll,
+       .poll           = qcam_poll,
        .unlocked_ioctl = video_ioctl2,
        .read           = qcam_read,
 };
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to