public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: unlisted-recipients:; (no To-header on input)@casper.infradead.org
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH RFCv3 17/17] [media] return -ENOTTY for unsupported ioctl's at legacy drivers
Date: Wed, 6 Jul 2011 15:03:49 -0300	[thread overview]
Message-ID: <20110706150349.44795968@pedra> (raw)
In-Reply-To: <cover.1309974026.git.mchehab@redhat.com>

Those drivers are not relying at the V4L2 core to handle the ioctl's.
So, we need to manually patch them every time a change goes to the
core.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

diff --git a/drivers/media/video/et61x251/et61x251_core.c b/drivers/media/video/et61x251/et61x251_core.c
index d7efb33..9a1e80a 100644
--- a/drivers/media/video/et61x251/et61x251_core.c
+++ b/drivers/media/video/et61x251/et61x251_core.c
@@ -2480,16 +2480,8 @@ static long et61x251_ioctl_v4l2(struct file *filp,
 	case VIDIOC_S_PARM:
 		return et61x251_vidioc_s_parm(cam, arg);
 
-	case VIDIOC_G_STD:
-	case VIDIOC_S_STD:
-	case VIDIOC_QUERYSTD:
-	case VIDIOC_ENUMSTD:
-	case VIDIOC_QUERYMENU:
-	case VIDIOC_ENUM_FRAMEINTERVALS:
-		return -EINVAL;
-
 	default:
-		return -EINVAL;
+		return -ENOTTY;
 
 	}
 }
diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
index 573749a..e27f8ab 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
@@ -369,11 +369,6 @@ static long pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
 		break;
 	}
 
-	case VIDIOC_S_AUDIO:
-	{
-		ret = -EINVAL;
-		break;
-	}
 	case VIDIOC_G_TUNER:
 	{
 		struct v4l2_tuner *vt = (struct v4l2_tuner *)arg;
@@ -850,7 +845,7 @@ static long pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
 #endif
 
 	default :
-		ret = -EINVAL;
+		ret = -ENOTTY;
 		break;
 	}
 
diff --git a/drivers/media/video/sn9c102/sn9c102_core.c b/drivers/media/video/sn9c102/sn9c102_core.c
index d8eece8..16cb07c 100644
--- a/drivers/media/video/sn9c102/sn9c102_core.c
+++ b/drivers/media/video/sn9c102/sn9c102_core.c
@@ -3187,16 +3187,8 @@ static long sn9c102_ioctl_v4l2(struct file *filp,
 	case VIDIOC_S_AUDIO:
 		return sn9c102_vidioc_s_audio(cam, arg);
 
-	case VIDIOC_G_STD:
-	case VIDIOC_S_STD:
-	case VIDIOC_QUERYSTD:
-	case VIDIOC_ENUMSTD:
-	case VIDIOC_QUERYMENU:
-	case VIDIOC_ENUM_FRAMEINTERVALS:
-		return -EINVAL;
-
 	default:
-		return -EINVAL;
+		return -ENOTTY;
 
 	}
 }
diff --git a/drivers/media/video/uvc/uvc_v4l2.c b/drivers/media/video/uvc/uvc_v4l2.c
index cdd967b..7afb97b 100644
--- a/drivers/media/video/uvc/uvc_v4l2.c
+++ b/drivers/media/video/uvc/uvc_v4l2.c
@@ -83,7 +83,7 @@ static int uvc_ioctl_ctrl_map(struct uvc_video_chain *chain,
 	default:
 		uvc_trace(UVC_TRACE_CONTROL, "Unsupported V4L2 control type "
 			  "%u.\n", xmap->v4l2_type);
-		ret = -EINVAL;
+		ret = -ENOTTY;
 		goto done;
 	}
 
-- 
1.7.1


       reply	other threads:[~2011-07-06 18:04 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1309974026.git.mchehab@redhat.com>
2011-07-06 18:03 ` Mauro Carvalho Chehab [this message]
2011-07-07 16:44   ` [PATCH RFCv3 17/17] [media] return -ENOTTY for unsupported ioctl's at legacy drivers Mike Isely
2011-07-06 18:03 ` [PATCH RFCv3 01/17] [media] DocBook: Add a chapter to describe media errors Mauro Carvalho Chehab
2011-07-06 18:03 ` [PATCH RFCv3 02/17] [media] DocBook: Use the generic ioctl error codes for all V4L ioctl's Mauro Carvalho Chehab
2011-07-06 18:03 ` [PATCH RFCv3 04/17] [media] DocBook/media-ioc-setup-link.xml: Remove EBUSY Mauro Carvalho Chehab
2011-07-06 18:03 ` [PATCH RFCv3 03/17] [media] DocBook: Use the generic error code page also for MC API Mauro Carvalho Chehab
2011-07-07 15:29   ` Hans Verkuil
2011-07-07 17:15     ` Mauro Carvalho Chehab
2011-07-07 17:28       ` Hans Verkuil
2011-07-07 17:46         ` Mauro Carvalho Chehab
2011-07-06 18:03 ` [PATCH RFCv3 05/17] [media] DocBook: Remove V4L generic error description for ioctl() Mauro Carvalho Chehab
2011-07-06 18:03 ` [PATCH RFCv3 06/17] [media] DocBook: Add an error code session for LIRC interface Mauro Carvalho Chehab
2011-07-06 18:03 ` [PATCH RFCv3 07/17] [media] DocBook: Add return error codes to LIRC ioctl session Mauro Carvalho Chehab
2011-07-06 18:03 ` [PATCH RFCv3 10/17] [media] DVB: Point to the generic error chapter Mauro Carvalho Chehab
2011-07-06 18:03 ` [PATCH RFCv3 11/17] [media] DocBook/audio.xml: Remove generic errors Mauro Carvalho Chehab
2011-07-06 18:03 ` [PATCH RFCv3 12/17] [media] DocBook/demux.xml: " Mauro Carvalho Chehab
2011-07-06 18:03 ` [PATCH RFCv3 13/17] [media] dvb-bt8xx: Don't return -EFAULT when a device is not found Mauro Carvalho Chehab
2011-07-06 18:03 ` [PATCH RFCv3 09/17] [media] nxt6000: i2c bus error should return -EIO Mauro Carvalho Chehab
2011-07-06 18:04 ` [PATCH RFCv3 08/17] [media] siano: bad parameter is -EINVAL and not -EFAULT Mauro Carvalho Chehab
2011-07-06 18:04 ` [PATCH RFCv3 14/17] [media] DocBook/dvb: Use generic descriptions for the frontend API Mauro Carvalho Chehab
2011-07-06 18:04 ` [PATCH RFCv3 15/17] [media] DocBook/dvb: Use generic descriptions for the video API Mauro Carvalho Chehab
2011-07-06 18:04 ` [PATCH RFCv3 16/17] [media] v4l2 core: return -ENOTTY if an ioctl doesn't exist Mauro Carvalho Chehab

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=20110706150349.44795968@pedra \
    --to=mchehab@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --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