em28xx: return -ENOTTY for tuner + frequency + VBI-format ioctls if the device is a webcam
Subsystems (2)
PATCH 1/1 em28xx: return -ENOTTY for tuner + frequency + VBI-format ioctls if the device is a webcam
Signed-off-by Frank Schäfer <[email protected]>
--- drivers/media/usb/em28xx/em28xx-video.c | 14 ++++++++++++++
1 Datei geändert, 14 Zeilen hinzugefügt(+)
drivers/media/usb/em28xx/em28xx-video.c +14 -0
@@ -1204,6 +1204,8 @@ static int vidioc_g_tuner(struct file *file, void *priv,struct em28xx *dev = fh->dev;int rc; +if (dev->board.is_webcam) +return -ENOTTY ; rc =check_dev (dev);if (rc <0 )return rc;
@@ -1224,6 +1226,8 @@ static int vidioc_s_tuner(struct file *file, void *priv,struct em28xx *dev = fh->dev;int rc; +if (dev->board.is_webcam) +return -ENOTTY ; rc =check_dev (dev);if (rc <0 )return rc;
@@ -1241,6 +1245,8 @@ static int vidioc_g_frequency(struct file *file, void *priv,struct em28xx_fh *fh = priv;struct em28xx *dev = fh->dev; +if (dev->board.is_webcam) +return -ENOTTY ;if (0 != f->tuner)return -EINVAL ;
@@ -1255,6 +1261,8 @@ static int vidioc_s_frequency(struct file *file, void *priv,struct em28xx *dev = fh->dev;int rc; +if (dev->board.is_webcam) +return -ENOTTY ; rc =check_dev (dev);if (rc <0 )return rc;
@@ -1499,6 +1507,9 @@ static int vidioc_g_fmt_vbi_cap(struct file *file, void *priv,struct em28xx_fh *fh = priv;struct em28xx *dev = fh->dev; +if (dev->board.is_webcam) +return -ENOTTY ; + format->fmt.vbi.samples_per_line = dev->vbi_width; format->fmt.vbi.sample_format =V4L2_PIX_FMT_GREY ; format->fmt.vbi.offset =0 ;
@@ -1528,6 +1539,9 @@ static int vidioc_s_fmt_vbi_cap(struct file *file, void *priv,struct em28xx_fh *fh = priv;struct em28xx *dev = fh->dev; +if (dev->board.is_webcam) +return -ENOTTY ; + format->fmt.vbi.samples_per_line = dev->vbi_width; format->fmt.vbi.sample_format =V4L2_PIX_FMT_GREY ; format->fmt.vbi.offset =0 ;
Signature · 1 line
1.7.10.4
Am 12.01.2013 18:51, schrieb Frank Schäfer:
Quoted 56 lines
Signed-off-by Frank Schäfer <[email protected]>--- drivers/media/usb/em28xx/em28xx-video.c | 14 ++++++++++++++1 Datei geändert, 14 Zeilen hinzugefügt(+)
drivers/media/usb/em28xx/em28xx-video.c +11
-0@@ -1204,6 +1204,8 @@ static int vidioc_g_tuner(struct file *file, void *priv,struct em28xx *dev = fh->dev;int rc; +if (dev->board.is_webcam) +return -ENOTTY ; rc =check_dev (dev);if (rc <0 )return rc;@@ -1224,6 +1226,8 @@ static int vidioc_s_tuner(struct file *file, void *priv,struct em28xx *dev = fh->dev;int rc; +if (dev->board.is_webcam) +return -ENOTTY ; rc =check_dev (dev);if (rc <0 )return rc;@@ -1241,6 +1245,8 @@ static int vidioc_g_frequency(struct file *file, void *priv,struct em28xx_fh *fh = priv;struct em28xx *dev = fh->dev; +if (dev->board.is_webcam) +return -ENOTTY ;if (0 != f->tuner)return -EINVAL ;@@ -1255,6 +1261,8 @@ static int vidioc_s_frequency(struct file *file, void *priv,struct em28xx *dev = fh->dev;int rc; +if (dev->board.is_webcam) +return -ENOTTY ; rc =check_dev (dev);if (rc <0 )return rc;@@ -1499,6 +1507,9 @@ static int vidioc_g_fmt_vbi_cap(struct file *file, void *priv,struct em28xx_fh *fh = priv;struct em28xx *dev = fh->dev; +if (dev->board.is_webcam) +return -ENOTTY ; + format->fmt.vbi.samples_per_line = dev->vbi_width; format->fmt.vbi.sample_format =V4L2_PIX_FMT_GREY ; format->fmt.vbi.offset =0 ;
drivers/media/usb/em28xx/em28xx-video.c static int vidioc_s_fmt_vbi_cap(struct file *file, void *priv, · line 1547
Quoted 9 lines
drivers/media/usb/em28xx/em28xx-video.c +3
-0@@ -1528,6 +1539,9 @@ static int vidioc_s_fmt_vbi_cap(struct file *file, void *priv,struct em28xx_fh *fh = priv;struct em28xx *dev = fh->dev; +if (dev->board.is_webcam) +return -ENOTTY ; + format->fmt.vbi.samples_per_line = dev->vbi_width; format->fmt.vbi.sample_format =V4L2_PIX_FMT_GREY ; format->fmt.vbi.offset =0 ;
Please disregard this patch, I will send a better one tomorrow.
Regards,
Frank