diff mbox

[RFC,04/18] tlg2300: remove ioctls that are invalid for radio devices.

Message ID fa815493501dbc166181e228f66319ac3398cd2c.1359627298.git.hans.verkuil@cisco.com (mailing list archive)
State New, archived
Headers show

Commit Message

Hans Verkuil Jan. 31, 2013, 10:25 a.m. UTC
From: Hans Verkuil <hans.verkuil@cisco.com>

The input and audio ioctls are only valid for video/vbi nodes.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/usb/tlg2300/pd-radio.c |   27 ---------------------------
 1 file changed, 27 deletions(-)

Comments

Huang Shijie Feb. 4, 2013, 4:16 a.m. UTC | #1
? 2013?01?31? 05:25, Hans Verkuil ??:
> From: Hans Verkuil <hans.verkuil@cisco.com>
>
> The input and audio ioctls are only valid for video/vbi nodes.

I remember that if you do not set these ioctrls, the mplayer will not works.

I can not download the mplayer in my home, so i can not test it.
I will test it in my office.

thanks
Huang Shijie

> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> ---
>  drivers/media/usb/tlg2300/pd-radio.c |   27 ---------------------------
>  1 file changed, 27 deletions(-)
>
> diff --git a/drivers/media/usb/tlg2300/pd-radio.c b/drivers/media/usb/tlg2300/pd-radio.c
> index c4feffb..4c76e089 100644
> --- a/drivers/media/usb/tlg2300/pd-radio.c
> +++ b/drivers/media/usb/tlg2300/pd-radio.c
> @@ -350,36 +350,9 @@ static int vidioc_s_tuner(struct file *file, void *priv, struct v4l2_tuner *vt)
>  {
>  	return vt->index > 0 ? -EINVAL : 0;
>  }
> -static int vidioc_s_audio(struct file *file, void *priv, const struct v4l2_audio *va)
> -{
> -	return (va->index != 0) ? -EINVAL : 0;
> -}
> -
> -static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a)
> -{
> -	a->index    = 0;
> -	a->mode    = 0;
> -	a->capability = V4L2_AUDCAP_STEREO;
> -	strcpy(a->name, "Radio");
> -	return 0;
> -}
> -
> -static int vidioc_s_input(struct file *filp, void *priv, u32 i)
> -{
> -	return (i != 0) ? -EINVAL : 0;
> -}
> -
> -static int vidioc_g_input(struct file *filp, void *priv, u32 *i)
> -{
> -	return (*i != 0) ? -EINVAL : 0;
> -}
>  
>  static const struct v4l2_ioctl_ops poseidon_fm_ioctl_ops = {
>  	.vidioc_querycap    = vidioc_querycap,
> -	.vidioc_g_audio     = vidioc_g_audio,
> -	.vidioc_s_audio     = vidioc_s_audio,
> -	.vidioc_g_input     = vidioc_g_input,
> -	.vidioc_s_input     = vidioc_s_input,
>  	.vidioc_queryctrl   = tlg_fm_vidioc_queryctrl,
>  	.vidioc_querymenu   = tlg_fm_vidioc_querymenu,
>  	.vidioc_g_ctrl      = tlg_fm_vidioc_g_ctrl,

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hans Verkuil Feb. 4, 2013, 8:34 a.m. UTC | #2
On Mon February 4 2013 05:16:32 Huang Shijie wrote:
> ? 2013?01?31? 05:25, Hans Verkuil ??:
> > From: Hans Verkuil <hans.verkuil@cisco.com>
> >
> > The input and audio ioctls are only valid for video/vbi nodes.
> 
> I remember that if you do not set these ioctrls, the mplayer will not works.

I have no problem with using mplayer for radio devices without those ioctls.

Regards,

	Hans

> 
> I can not download the mplayer in my home, so i can not test it.
> I will test it in my office.
> 
> thanks
> Huang Shijie
> 
> > Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> > ---
> >  drivers/media/usb/tlg2300/pd-radio.c |   27 ---------------------------
> >  1 file changed, 27 deletions(-)
> >
> > diff --git a/drivers/media/usb/tlg2300/pd-radio.c b/drivers/media/usb/tlg2300/pd-radio.c
> > index c4feffb..4c76e089 100644
> > --- a/drivers/media/usb/tlg2300/pd-radio.c
> > +++ b/drivers/media/usb/tlg2300/pd-radio.c
> > @@ -350,36 +350,9 @@ static int vidioc_s_tuner(struct file *file, void *priv, struct v4l2_tuner *vt)
> >  {
> >  	return vt->index > 0 ? -EINVAL : 0;
> >  }
> > -static int vidioc_s_audio(struct file *file, void *priv, const struct v4l2_audio *va)
> > -{
> > -	return (va->index != 0) ? -EINVAL : 0;
> > -}
> > -
> > -static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a)
> > -{
> > -	a->index    = 0;
> > -	a->mode    = 0;
> > -	a->capability = V4L2_AUDCAP_STEREO;
> > -	strcpy(a->name, "Radio");
> > -	return 0;
> > -}
> > -
> > -static int vidioc_s_input(struct file *filp, void *priv, u32 i)
> > -{
> > -	return (i != 0) ? -EINVAL : 0;
> > -}
> > -
> > -static int vidioc_g_input(struct file *filp, void *priv, u32 *i)
> > -{
> > -	return (*i != 0) ? -EINVAL : 0;
> > -}
> >  
> >  static const struct v4l2_ioctl_ops poseidon_fm_ioctl_ops = {
> >  	.vidioc_querycap    = vidioc_querycap,
> > -	.vidioc_g_audio     = vidioc_g_audio,
> > -	.vidioc_s_audio     = vidioc_s_audio,
> > -	.vidioc_g_input     = vidioc_g_input,
> > -	.vidioc_s_input     = vidioc_s_input,
> >  	.vidioc_queryctrl   = tlg_fm_vidioc_queryctrl,
> >  	.vidioc_querymenu   = tlg_fm_vidioc_querymenu,
> >  	.vidioc_g_ctrl      = tlg_fm_vidioc_g_ctrl,
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Huang Shijie Feb. 5, 2013, 4:03 a.m. UTC | #3
? 2013?01?31? 05:25, Hans Verkuil ??:
> From: Hans Verkuil <hans.verkuil@cisco.com>
>
> The input and audio ioctls are only valid for video/vbi nodes.
>
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> ---
>  drivers/media/usb/tlg2300/pd-radio.c |   27 ---------------------------
>  1 file changed, 27 deletions(-)
>
> diff --git a/drivers/media/usb/tlg2300/pd-radio.c b/drivers/media/usb/tlg2300/pd-radio.c
> index c4feffb..4c76e089 100644
> --- a/drivers/media/usb/tlg2300/pd-radio.c
> +++ b/drivers/media/usb/tlg2300/pd-radio.c
> @@ -350,36 +350,9 @@ static int vidioc_s_tuner(struct file *file, void *priv, struct v4l2_tuner *vt)
>  {
>  	return vt->index > 0 ? -EINVAL : 0;
>  }
> -static int vidioc_s_audio(struct file *file, void *priv, const struct v4l2_audio *va)
> -{
> -	return (va->index != 0) ? -EINVAL : 0;
> -}
> -
> -static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a)
> -{
> -	a->index    = 0;
> -	a->mode    = 0;
> -	a->capability = V4L2_AUDCAP_STEREO;
> -	strcpy(a->name, "Radio");
> -	return 0;
> -}
> -
> -static int vidioc_s_input(struct file *filp, void *priv, u32 i)
> -{
> -	return (i != 0) ? -EINVAL : 0;
> -}
> -
> -static int vidioc_g_input(struct file *filp, void *priv, u32 *i)
> -{
> -	return (*i != 0) ? -EINVAL : 0;
> -}
>  
>  static const struct v4l2_ioctl_ops poseidon_fm_ioctl_ops = {
>  	.vidioc_querycap    = vidioc_querycap,
> -	.vidioc_g_audio     = vidioc_g_audio,
> -	.vidioc_s_audio     = vidioc_s_audio,
> -	.vidioc_g_input     = vidioc_g_input,
> -	.vidioc_s_input     = vidioc_s_input,
>  	.vidioc_queryctrl   = tlg_fm_vidioc_queryctrl,
>  	.vidioc_querymenu   = tlg_fm_vidioc_querymenu,
>  	.vidioc_g_ctrl      = tlg_fm_vidioc_g_ctrl,

I tested this patch. it seems ok.
thanks.

Acked-by: Huang Shijie <shijie8@gmail.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/media/usb/tlg2300/pd-radio.c b/drivers/media/usb/tlg2300/pd-radio.c
index c4feffb..4c76e089 100644
--- a/drivers/media/usb/tlg2300/pd-radio.c
+++ b/drivers/media/usb/tlg2300/pd-radio.c
@@ -350,36 +350,9 @@  static int vidioc_s_tuner(struct file *file, void *priv, struct v4l2_tuner *vt)
 {
 	return vt->index > 0 ? -EINVAL : 0;
 }
-static int vidioc_s_audio(struct file *file, void *priv, const struct v4l2_audio *va)
-{
-	return (va->index != 0) ? -EINVAL : 0;
-}
-
-static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a)
-{
-	a->index    = 0;
-	a->mode    = 0;
-	a->capability = V4L2_AUDCAP_STEREO;
-	strcpy(a->name, "Radio");
-	return 0;
-}
-
-static int vidioc_s_input(struct file *filp, void *priv, u32 i)
-{
-	return (i != 0) ? -EINVAL : 0;
-}
-
-static int vidioc_g_input(struct file *filp, void *priv, u32 *i)
-{
-	return (*i != 0) ? -EINVAL : 0;
-}
 
 static const struct v4l2_ioctl_ops poseidon_fm_ioctl_ops = {
 	.vidioc_querycap    = vidioc_querycap,
-	.vidioc_g_audio     = vidioc_g_audio,
-	.vidioc_s_audio     = vidioc_s_audio,
-	.vidioc_g_input     = vidioc_g_input,
-	.vidioc_s_input     = vidioc_s_input,
 	.vidioc_queryctrl   = tlg_fm_vidioc_queryctrl,
 	.vidioc_querymenu   = tlg_fm_vidioc_querymenu,
 	.vidioc_g_ctrl      = tlg_fm_vidioc_g_ctrl,