public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: "Frank Schäfer" <fschaefer.oss@googlemail.com>
Cc: hverkuil@xs4all.nl, linux-media@vger.kernel.org,
	Mike Isely <isely@isely.net>
Subject: Re: [PATCH] v4l2-core: do not enable the buffer ioctls for radio devices
Date: Tue, 22 Jan 2013 20:14:50 -0200	[thread overview]
Message-ID: <20130122201450.2f337ee1@sabia.mchehab> (raw)
In-Reply-To: <1358884315-2810-1-git-send-email-fschaefer.oss@googlemail.com>

Em Tue, 22 Jan 2013 20:51:55 +0100
Frank Schäfer <fschaefer.oss@googlemail.com> escreveu:

> The buffer ioctls (VIDIOC_REQBUFS, VIDIOC_QUERYBUF, VIDIOC_QBUF, VIDIOC_DQBUF,
> VIDIOC_EXPBUF, VIDIOC_CREATE_BUFS, VIDIOC_PREPARE_BUF) are not applicable for
> radio devices. Hence, they should be set valid only for non-radio devices in
> determine_valid_ioctls().

Hmm... wouldn't it could break or cause regressions to pvrusb2 (and cx18/ivtv?)?

Regards,
Mauro
> 
> Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
> ---
>  drivers/media/v4l2-core/v4l2-dev.c |   14 +++++++-------
>  1 Datei geändert, 7 Zeilen hinzugefügt(+), 7 Zeilen entfernt(-)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c
> index 98dcad9..51b3a77 100644
> --- a/drivers/media/v4l2-core/v4l2-dev.c
> +++ b/drivers/media/v4l2-core/v4l2-dev.c
> @@ -568,11 +568,6 @@ static void determine_valid_ioctls(struct video_device *vdev)
>  	if (ops->vidioc_s_priority ||
>  			test_bit(V4L2_FL_USE_FH_PRIO, &vdev->flags))
>  		set_bit(_IOC_NR(VIDIOC_S_PRIORITY), valid_ioctls);
> -	SET_VALID_IOCTL(ops, VIDIOC_REQBUFS, vidioc_reqbufs);
> -	SET_VALID_IOCTL(ops, VIDIOC_QUERYBUF, vidioc_querybuf);
> -	SET_VALID_IOCTL(ops, VIDIOC_QBUF, vidioc_qbuf);
> -	SET_VALID_IOCTL(ops, VIDIOC_EXPBUF, vidioc_expbuf);
> -	SET_VALID_IOCTL(ops, VIDIOC_DQBUF, vidioc_dqbuf);
>  	SET_VALID_IOCTL(ops, VIDIOC_STREAMON, vidioc_streamon);
>  	SET_VALID_IOCTL(ops, VIDIOC_STREAMOFF, vidioc_streamoff);
>  	/* Note: the control handler can also be passed through the filehandle,
> @@ -605,8 +600,6 @@ static void determine_valid_ioctls(struct video_device *vdev)
>  	SET_VALID_IOCTL(ops, VIDIOC_DQEVENT, vidioc_subscribe_event);
>  	SET_VALID_IOCTL(ops, VIDIOC_SUBSCRIBE_EVENT, vidioc_subscribe_event);
>  	SET_VALID_IOCTL(ops, VIDIOC_UNSUBSCRIBE_EVENT, vidioc_unsubscribe_event);
> -	SET_VALID_IOCTL(ops, VIDIOC_CREATE_BUFS, vidioc_create_bufs);
> -	SET_VALID_IOCTL(ops, VIDIOC_PREPARE_BUF, vidioc_prepare_buf);
>  	if (ops->vidioc_enum_freq_bands || ops->vidioc_g_tuner || ops->vidioc_g_modulator)
>  		set_bit(_IOC_NR(VIDIOC_ENUM_FREQ_BANDS), valid_ioctls);
>  
> @@ -672,6 +665,13 @@ static void determine_valid_ioctls(struct video_device *vdev)
>  	}
>  	if (!is_radio) {
>  		/* ioctls valid for video or vbi */
> +		SET_VALID_IOCTL(ops, VIDIOC_REQBUFS, vidioc_reqbufs);
> +		SET_VALID_IOCTL(ops, VIDIOC_QUERYBUF, vidioc_querybuf);
> +		SET_VALID_IOCTL(ops, VIDIOC_QBUF, vidioc_qbuf);
> +		SET_VALID_IOCTL(ops, VIDIOC_EXPBUF, vidioc_expbuf);
> +		SET_VALID_IOCTL(ops, VIDIOC_DQBUF, vidioc_dqbuf);
> +		SET_VALID_IOCTL(ops, VIDIOC_CREATE_BUFS, vidioc_create_bufs);
> +		SET_VALID_IOCTL(ops, VIDIOC_PREPARE_BUF, vidioc_prepare_buf);
>  		if (ops->vidioc_s_std)
>  			set_bit(_IOC_NR(VIDIOC_ENUMSTD), valid_ioctls);
>  		if (ops->vidioc_g_std || vdev->current_norm)




Cheers,
Mauro

  reply	other threads:[~2013-01-22 22:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-22 19:51 [PATCH] v4l2-core: do not enable the buffer ioctls for radio devices Frank Schäfer
2013-01-22 22:14 ` Mauro Carvalho Chehab [this message]
2013-01-23  7:22   ` Hans Verkuil

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=20130122201450.2f337ee1@sabia.mchehab \
    --to=mchehab@redhat.com \
    --cc=fschaefer.oss@googlemail.com \
    --cc=hverkuil@xs4all.nl \
    --cc=isely@isely.net \
    --cc=linux-media@vger.kernel.org \
    /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