linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFCv3 17/17] [media] return -ENOTTY for unsupported ioctl's at legacy drivers
       [not found] <cover.1309974026.git.mchehab@redhat.com>
@ 2011-07-06 18:03 ` Mauro Carvalho Chehab
  2011-07-07 16:44   ` Mike Isely
  2011-07-11 11:03   ` Laurent Pinchart
  2011-07-06 18:03 ` [PATCH RFCv3 01/17] [media] DocBook: Add a chapter to describe media errors Mauro Carvalho Chehab
                   ` (15 subsequent siblings)
  16 siblings, 2 replies; 23+ messages in thread
From: Mauro Carvalho Chehab @ 2011-07-06 18:03 UTC (permalink / raw)
  Cc: Linux Media Mailing List, Linux Kernel Mailing List

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


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH RFCv3 01/17] [media] DocBook: Add a chapter to describe media errors
       [not found] <cover.1309974026.git.mchehab@redhat.com>
  2011-07-06 18:03 ` [PATCH RFCv3 17/17] [media] return -ENOTTY for unsupported ioctl's at legacy drivers Mauro Carvalho Chehab
@ 2011-07-06 18:03 ` 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
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 23+ messages in thread
From: Mauro Carvalho Chehab @ 2011-07-06 18:03 UTC (permalink / raw)
  Cc: Linux Media Mailing List, Linux Kernel Mailing List

There are several errors reported by V4L that aren't described.
They can occur on almost all ioctl's. Instead of adding them
into each ioctl, create a new chapter.

For V4L, the new chapter will automatically be listed on all
places, as there's a macro used everywhere there.

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

 create mode 100644 Documentation/DocBook/media/v4l/gen-errors.xml

diff --git a/Documentation/DocBook/.gitignore b/Documentation/DocBook/.gitignore
index 25214a5..720f245 100644
--- a/Documentation/DocBook/.gitignore
+++ b/Documentation/DocBook/.gitignore
@@ -8,5 +8,7 @@
 *.dvi
 *.log
 *.out
+*.png
+*.gif
 media-indices.tmpl
 media-entities.tmpl
diff --git a/Documentation/DocBook/media/Makefile b/Documentation/DocBook/media/Makefile
index 8cb27f3..6628b4b 100644
--- a/Documentation/DocBook/media/Makefile
+++ b/Documentation/DocBook/media/Makefile
@@ -100,23 +100,59 @@ STRUCTS = \
 	$(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/linux/v4l2-mediabus.h)
 
 ERRORS = \
+	E2BIG \
 	EACCES \
 	EAGAIN \
 	EBADF \
+	EBADFD \
+	EBADR \
+	EBADRQC \
 	EBUSY \
+	ECHILD \
+	ECONNRESET \
+	EDEADLK \
+	EDOM \
+	EEXIST \
 	EFAULT \
-	EIO \
+	EFBIG \
+	EILSEQ \
+	EINIT \
+	EINPROGRESS \
 	EINTR \
 	EINVAL \
+	EIO \
+	EMFILE \
 	ENFILE \
+	ENOBUFS \
+	ENODATA \
+	ENODEV \
+	ENOENT \
+	ENOIOCTLCMD \
 	ENOMEM \
 	ENOSPC \
+	ENOSR \
+	ENOSYS \
+	ENOTSUP \
+	ENOTSUPP \
 	ENOTTY \
 	ENXIO \
-	EMFILE \
+	EOPNOTSUPP \
+	EOVERFLOW \
 	EPERM \
-	ERANGE \
 	EPIPE \
+	EPROTO \
+	ERANGE \
+	EREMOTE \
+	EREMOTEIO \
+	ERESTART \
+	ERESTARTSYS \
+	ESHUTDOWN \
+	ESPIPE \
+	ETIME \
+	ETIMEDOUT \
+	EUSERS \
+	EWOULDBLOCK \
+	EXDEV \
 
 ESCAPE = \
 	-e "s/&/\\&amp;/g" \
diff --git a/Documentation/DocBook/media/v4l/gen-errors.xml b/Documentation/DocBook/media/v4l/gen-errors.xml
new file mode 100644
index 0000000..1efc688
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/gen-errors.xml
@@ -0,0 +1,17 @@
+<title>Generic Error Codes</title>
+
+<table frame="none" pgwide="1" id="gen-errors">
+  <title>Generic error codes</title>
+  <tgroup cols="2">
+    &cs-str;
+    <tbody valign="top">
+      <row>
+	<entry>EBUSY</entry>
+	<entry>The ioctl can't be handled because the device is busy. This is
+	       typically return while device is streaming, and an ioctl tried to
+	       change something that would affect the stream, or would require the
+	       usage of a hardware resource that was already allocated.</entry>
+      </row>
+    </tbody>
+  </tgroup>
+</table>
diff --git a/Documentation/DocBook/media_api.tmpl b/Documentation/DocBook/media_api.tmpl
index 88f2cc6..bdb06bc 100644
--- a/Documentation/DocBook/media_api.tmpl
+++ b/Documentation/DocBook/media_api.tmpl
@@ -8,7 +8,7 @@
 <!ENTITY ie                     "i.&nbsp;e.">
 <!ENTITY fd                     "File descriptor returned by <link linkend='func-open'><function>open()</function></link>.">
 <!ENTITY i2c                    "I<superscript>2</superscript>C">
-<!ENTITY return-value		"<title>Return Value</title><para>On success <returnvalue>0</returnvalue> is returned, on error <returnvalue>-1</returnvalue> and the <varname>errno</varname> variable is set appropriately:</para>">
+<!ENTITY return-value		"<title>Return Value</title><para>On success <returnvalue>0</returnvalue> is returned, on error <returnvalue>-1</returnvalue> and the <varname>errno</varname> variable is set appropriately. The generic error codes are described at the <link linkend='gen-errors'>Generic Error Codes</link> chapter.</para>">
 <!ENTITY manvol                 "<manvolnum>2</manvolnum>">
 
 <!-- Table templates: structs, structs w/union, defines. -->
@@ -110,6 +109,11 @@ Foundation. A copy of the license is included in the chapter entitled
 &sub-media-controller;
 </part>
 
+<chapter id="gen_errors">
+&sub-gen-errors;
+</chapter>
+
+
 &sub-fdl-appendix;
 
 </book>
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH RFCv3 02/17] [media] DocBook: Use the generic ioctl error codes for all V4L ioctl's
       [not found] <cover.1309974026.git.mchehab@redhat.com>
  2011-07-06 18:03 ` [PATCH RFCv3 17/17] [media] return -ENOTTY for unsupported ioctl's at legacy drivers Mauro Carvalho Chehab
  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 ` 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
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 23+ messages in thread
From: Mauro Carvalho Chehab @ 2011-07-06 18:03 UTC (permalink / raw)
  Cc: Linux Media Mailing List, Linux Kernel Mailing List

Be sure that all VIDIOC_* ioctl are using the return error macro, and
aren't specifying generic error codes internally.

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

diff --git a/Documentation/DocBook/media/v4l/gen-errors.xml b/Documentation/DocBook/media/v4l/gen-errors.xml
index 1efc688..6ef476a 100644
--- a/Documentation/DocBook/media/v4l/gen-errors.xml
+++ b/Documentation/DocBook/media/v4l/gen-errors.xml
@@ -10,7 +10,24 @@
 	<entry>The ioctl can't be handled because the device is busy. This is
 	       typically return while device is streaming, and an ioctl tried to
 	       change something that would affect the stream, or would require the
-	       usage of a hardware resource that was already allocated.</entry>
+	       usage of a hardware resource that was already allocated. The ioctl
+	       must not be retried without performing another action to fix the
+	       problem first (typically: stop the stream before retrying).</entry>
+      </row>
+      <row>
+	<entry>EINVAL</entry>
+	<entry>The ioctl is not supported by the driver, actually meaning that
+	       the required functionality is not available.</entry>
+      </row>
+      <row>
+	<entry>ENOMEM</entry>
+	<entry>There's not enough memory to handle the desired operation.</entry>
+      </row>
+      <row>
+	<entry>ENOSPC</entry>
+	<entry>On USB devices, the stream ioctl's can return this error meaning
+	       that this request would overcommit the usb bandwidth reserved
+	       for periodic transfers (up to 80% of the USB bandwidth).</entry>
       </row>
     </tbody>
   </tgroup>
diff --git a/Documentation/DocBook/media/v4l/vidioc-cropcap.xml b/Documentation/DocBook/media/v4l/vidioc-cropcap.xml
index 816e90e..b4f2f25 100644
--- a/Documentation/DocBook/media/v4l/vidioc-cropcap.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-cropcap.xml
@@ -156,19 +156,10 @@ on 22 Oct 2002 subject "Re:[V4L][patches!] Re:v4l2/kernel-2.5" -->
 	<term><errorcode>EINVAL</errorcode></term>
 	<listitem>
 	  <para>The &v4l2-cropcap; <structfield>type</structfield> is
-invalid or the ioctl is not supported. This is not permitted for
-video capture, output and overlay devices, which must support
-<constant>VIDIOC_CROPCAP</constant>.</para>
+invalid. This is not permitted for video capture, output and overlay devices,
+which must support <constant>VIDIOC_CROPCAP</constant>.</para>
 	</listitem>
       </varlistentry>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-dbg-g-chip-ident.xml b/Documentation/DocBook/media/v4l/vidioc-dbg-g-chip-ident.xml
index 4a09e20..4ecd966 100644
--- a/Documentation/DocBook/media/v4l/vidioc-dbg-g-chip-ident.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-dbg-g-chip-ident.xml
@@ -258,18 +258,9 @@ could not identify it.</entry>
       <varlistentry>
 	<term><errorcode>EINVAL</errorcode></term>
 	<listitem>
-	  <para>The driver does not support this ioctl, or the
-<structfield>match_type</structfield> is invalid.</para>
+	  <para>The <structfield>match_type</structfield> is invalid.</para>
 	</listitem>
       </varlistentry>
      </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-dbg-g-register.xml b/Documentation/DocBook/media/v4l/vidioc-dbg-g-register.xml
index 980c7f3..a44aebc 100644
--- a/Documentation/DocBook/media/v4l/vidioc-dbg-g-register.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-dbg-g-register.xml
@@ -247,15 +247,6 @@ register.</entry>
 
     <variablelist>
       <varlistentry>
-	<term><errorcode>EINVAL</errorcode></term>
-	<listitem>
-	  <para>The driver does not support this ioctl, or the kernel
-was not compiled with the <constant>CONFIG_VIDEO_ADV_DEBUG</constant>
-option, or the <structfield>match_type</structfield> is invalid, or the
-selected chip or register does not exist.</para>
-	</listitem>
-      </varlistentry>
-      <varlistentry>
 	<term><errorcode>EPERM</errorcode></term>
 	<listitem>
 	  <para>Insufficient permissions. Root privileges are required
@@ -265,11 +256,3 @@ to execute these ioctls.</para>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-dqevent.xml b/Documentation/DocBook/media/v4l/vidioc-dqevent.xml
index b8c4f76..7769642 100644
--- a/Documentation/DocBook/media/v4l/vidioc-dqevent.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-dqevent.xml
@@ -136,11 +136,7 @@
     </table>
 
   </refsect1>
+  <refsect1>
+    &return-value;
+  </refsect1>
 </refentry>
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml b/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml
index b0dde94..af7f3f2 100644
--- a/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml
@@ -180,8 +180,7 @@ Pictures</wordasword>, rather than immediately.</entry>
       <varlistentry>
 	<term><errorcode>EINVAL</errorcode></term>
 	<listitem>
-	  <para>The driver does not support this ioctl, or the
-<structfield>cmd</structfield> field is invalid.</para>
+	  <para>The <structfield>cmd</structfield> field is invalid.</para>
 	</listitem>
       </varlistentry>
       <varlistentry>
@@ -194,11 +193,3 @@ the encoder was not running.</para>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-enum-frameintervals.xml b/Documentation/DocBook/media/v4l/vidioc-enum-frameintervals.xml
index 3c216e1..5fd72c4 100644
--- a/Documentation/DocBook/media/v4l/vidioc-enum-frameintervals.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-enum-frameintervals.xml
@@ -254,17 +254,6 @@ enumerated.</entry>
 
   <refsect1>
     &return-value;
-
-    <para>See the description section above for a list of return
-values that <varname>errno</varname> can have.</para>
   </refsect1>
 
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-enum-framesizes.xml b/Documentation/DocBook/media/v4l/vidioc-enum-framesizes.xml
index 6afa454..f77a13f 100644
--- a/Documentation/DocBook/media/v4l/vidioc-enum-framesizes.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-enum-framesizes.xml
@@ -267,16 +267,5 @@ application should zero out all members except for the
 
   <refsect1>
     &return-value;
-
-    <para>See the description section above for a list of return
-values that <varname>errno</varname> can have.</para>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-enumaudio.xml b/Documentation/DocBook/media/v4l/vidioc-enumaudio.xml
index 9ae8f2d..ea816ab 100644
--- a/Documentation/DocBook/media/v4l/vidioc-enumaudio.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-enumaudio.xml
@@ -68,19 +68,9 @@ until the driver returns <errorcode>EINVAL</errorcode>.</para>
       <varlistentry>
 	<term><errorcode>EINVAL</errorcode></term>
 	<listitem>
-	  <para>The number of the audio input is out of bounds, or
-there are no audio inputs at all and this ioctl is not
-supported.</para>
+	  <para>The number of the audio input is out of bounds.</para>
 	</listitem>
       </varlistentry>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-enumaudioout.xml b/Documentation/DocBook/media/v4l/vidioc-enumaudioout.xml
index d3d7c0a..2e87ced 100644
--- a/Documentation/DocBook/media/v4l/vidioc-enumaudioout.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-enumaudioout.xml
@@ -71,19 +71,9 @@ signal to a sound card are not audio outputs in this sense.</para>
       <varlistentry>
 	<term><errorcode>EINVAL</errorcode></term>
 	<listitem>
-	  <para>The number of the audio output is out of bounds, or
-there are no audio outputs at all and this ioctl is not
-supported.</para>
+	  <para>The number of the audio output is out of bounds.</para>
 	</listitem>
       </varlistentry>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-audio.xml b/Documentation/DocBook/media/v4l/vidioc-g-audio.xml
index 65361a8..d7bb9b3 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-audio.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-audio.xml
@@ -164,25 +164,9 @@ tuner.</entry>
 	<listitem>
 	  <para>No audio inputs combine with the current video input,
 or the number of the selected audio input is out of bounds or it does
-not combine, or there are no audio inputs at all and the ioctl is not
-supported.</para>
-	</listitem>
-      </varlistentry>
-      <varlistentry>
-	<term><errorcode>EBUSY</errorcode></term>
-	<listitem>
-	  <para>I/O is in progress, the input cannot be
-switched.</para>
+not combine.</para>
 	</listitem>
       </varlistentry>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-audioout.xml b/Documentation/DocBook/media/v4l/vidioc-g-audioout.xml
index 3632730..200a270 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-audioout.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-audioout.xml
@@ -130,25 +130,9 @@ applications must set the array to zero.</entry>
 	<listitem>
 	  <para>No audio outputs combine with the current video
 output, or the number of the selected audio output is out of bounds or
-it does not combine, or there are no audio outputs at all and the
-ioctl is not supported.</para>
-	</listitem>
-      </varlistentry>
-      <varlistentry>
-	<term><errorcode>EBUSY</errorcode></term>
-	<listitem>
-	  <para>I/O is in progress, the output cannot be
-switched.</para>
+it does not combine.</para>
 	</listitem>
       </varlistentry>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-crop.xml b/Documentation/DocBook/media/v4l/vidioc-g-crop.xml
index d235b1d..01a5064 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-crop.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-crop.xml
@@ -122,22 +122,5 @@ for &v4l2-cropcap; <structfield>bounds</structfield> is used.</entry>
 
   <refsect1>
     &return-value;
-
-    <variablelist>
-      <varlistentry>
-	<term><errorcode>EINVAL</errorcode></term>
-	<listitem>
-	  <para>Cropping is not supported.</para>
-	</listitem>
-      </varlistentry>
-    </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-dv-preset.xml b/Documentation/DocBook/media/v4l/vidioc-g-dv-preset.xml
index d733721..7940c11 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-dv-preset.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-dv-preset.xml
@@ -97,14 +97,8 @@ If the preset is not supported, it returns an &EINVAL; </para>
 	</tbody>
       </tgroup>
     </table>
-
+  </refsect1>
+  <refsect1>
+    &return-value;
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml b/Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml
index d5ec6ab..4a8648a 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml
@@ -212,12 +212,7 @@ bit 0 (V4L2_DV_VSYNC_POS_POL) is for vertical sync polarity and bit 1 (V4L2_DV_H
       </tgroup>
     </table>
   </refsect1>
+  <refsect1>
+    &return-value;
+  </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-enc-index.xml b/Documentation/DocBook/media/v4l/vidioc-g-enc-index.xml
index 9f242e4..2aef02c 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-enc-index.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-enc-index.xml
@@ -192,22 +192,5 @@ this mask to obtain the picture coding type.</entry>
 
   <refsect1>
     &return-value;
-
-    <variablelist>
-      <varlistentry>
-	<term><errorcode>EINVAL</errorcode></term>
-	<listitem>
-	  <para>The driver does not support this ioctl.</para>
-	</listitem>
-      </varlistentry>
-    </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-fbuf.xml b/Documentation/DocBook/media/v4l/vidioc-g-fbuf.xml
index e7dda48..0557182 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-fbuf.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-fbuf.xml
@@ -446,28 +446,11 @@ overlay.</para>
 	</listitem>
       </varlistentry>
       <varlistentry>
-	<term><errorcode>EBUSY</errorcode></term>
-	<listitem>
-	  <para>The framebuffer parameters cannot be changed at this
-time because overlay is already enabled, or capturing is enabled
-and the hardware cannot capture and overlay simultaneously.</para>
-	</listitem>
-      </varlistentry>
-      <varlistentry>
 	<term><errorcode>EINVAL</errorcode></term>
 	<listitem>
-	  <para>The ioctl is not supported or the
-<constant>VIDIOC_S_FBUF</constant> parameters are unsuitable.</para>
+	  <para>The <constant>VIDIOC_S_FBUF</constant> parameters are unsuitable.</para>
 	</listitem>
       </varlistentry>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml b/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml
index a4ae59b..17fbda1 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml
@@ -184,29 +184,13 @@ capture and output devices.</entry>
 
     <variablelist>
       <varlistentry>
-	<term><errorcode>EBUSY</errorcode></term>
-	<listitem>
-	  <para>The data format cannot be changed at this
-time, for example because I/O is already in progress.</para>
-	</listitem>
-      </varlistentry>
-      <varlistentry>
 	<term><errorcode>EINVAL</errorcode></term>
 	<listitem>
 	  <para>The &v4l2-format; <structfield>type</structfield>
-field is invalid, the requested buffer type not supported, or
-<constant>VIDIOC_TRY_FMT</constant> was called and is not
-supported with this buffer type.</para>
+field is invalid, the requested buffer type not supported, or the
+format is not supported with this buffer type.</para>
 	</listitem>
       </varlistentry>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-input.xml b/Documentation/DocBook/media/v4l/vidioc-g-input.xml
index ed076e9..08ae82f 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-input.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-input.xml
@@ -75,26 +75,9 @@ querying or negotiating any other parameters.</para>
       <varlistentry>
 	<term><errorcode>EINVAL</errorcode></term>
 	<listitem>
-	  <para>The number of the video input is out of bounds, or
-there are no video inputs at all and this ioctl is not
-supported.</para>
-	</listitem>
-      </varlistentry>
-      <varlistentry>
-	<term><errorcode>EBUSY</errorcode></term>
-	<listitem>
-	  <para>I/O is in progress, the input cannot be
-switched.</para>
+	  <para>The number of the video input is out of bounds.</para>
 	</listitem>
       </varlistentry>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-jpegcomp.xml b/Documentation/DocBook/media/v4l/vidioc-g-jpegcomp.xml
index 77394b2..01ea24b 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-jpegcomp.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-jpegcomp.xml
@@ -159,22 +159,5 @@ to add them.</para>
 
   <refsect1>
     &return-value;
-
-    <variablelist>
-      <varlistentry>
-	<term><errorcode>EINVAL</errorcode></term>
-	<listitem>
-	  <para>This ioctl is not supported.</para>
-	</listitem>
-      </varlistentry>
-    </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-output.xml b/Documentation/DocBook/media/v4l/vidioc-g-output.xml
index 3ea8c0e..fd45f1c 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-output.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-output.xml
@@ -76,25 +76,9 @@ negotiating any other parameters.</para>
 	<term><errorcode>EINVAL</errorcode></term>
 	<listitem>
 	  <para>The number of the video output is out of bounds, or
-there are no video outputs at all and this ioctl is not
-supported.</para>
-	</listitem>
-      </varlistentry>
-      <varlistentry>
-	<term><errorcode>EBUSY</errorcode></term>
-	<listitem>
-	  <para>I/O is in progress, the output cannot be
-switched.</para>
+there are no video outputs at all.</para>
 	</listitem>
       </varlistentry>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-parm.xml b/Documentation/DocBook/media/v4l/vidioc-g-parm.xml
index 392aa9e..19b1d85 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-parm.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-parm.xml
@@ -311,22 +311,5 @@ excessive motion blur. </para>
 
   <refsect1>
     &return-value;
-
-    <variablelist>
-      <varlistentry>
-	<term><errorcode>EINVAL</errorcode></term>
-	<listitem>
-	  <para>This ioctl is not supported.</para>
-	</listitem>
-      </varlistentry>
-    </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-priority.xml b/Documentation/DocBook/media/v4l/vidioc-g-priority.xml
index 5fb0019..8f5e3da 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-priority.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-priority.xml
@@ -120,8 +120,7 @@ recording.</entry>
       <varlistentry>
 	<term><errorcode>EINVAL</errorcode></term>
 	<listitem>
-	  <para>The requested priority value is invalid, or the
-driver does not support access priorities.</para>
+	  <para>The requested priority value is invalid.</para>
 	</listitem>
       </varlistentry>
       <varlistentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-sliced-vbi-cap.xml b/Documentation/DocBook/media/v4l/vidioc-g-sliced-vbi-cap.xml
index 10e721b..71741da 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-sliced-vbi-cap.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-sliced-vbi-cap.xml
@@ -246,19 +246,10 @@ line systems.</entry>
       <varlistentry>
 	<term><errorcode>EINVAL</errorcode></term>
 	<listitem>
-	  <para>The device does not support sliced VBI capturing or
-output, or the value in the <structfield>type</structfield> field is
+	  <para>The value in the <structfield>type</structfield> field is
 wrong.</para>
 	</listitem>
       </varlistentry>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-std.xml b/Documentation/DocBook/media/v4l/vidioc-g-std.xml
index 912f851..37996f2 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-std.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-std.xml
@@ -82,14 +82,7 @@ standards.</para>
       <varlistentry>
 	<term><errorcode>EINVAL</errorcode></term>
 	<listitem>
-	  <para>This ioctl is not supported, or the
-<constant>VIDIOC_S_STD</constant> parameter was unsuitable.</para>
-	</listitem>
-      </varlistentry>
-      <varlistentry>
-	<term><errorcode>EBUSY</errorcode></term>
-	<listitem>
-	  <para>The device is busy and therefore can not change the standard</para>
+	  <para>The <constant>VIDIOC_S_STD</constant> parameter was unsuitable.</para>
 	</listitem>
       </varlistentry>
     </variablelist>
diff --git a/Documentation/DocBook/media/v4l/vidioc-log-status.xml b/Documentation/DocBook/media/v4l/vidioc-log-status.xml
index 2634b7c..5ded7d3 100644
--- a/Documentation/DocBook/media/v4l/vidioc-log-status.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-log-status.xml
@@ -37,22 +37,5 @@ was introduced in Linux 2.6.15.</para>
 
   <refsect1>
     &return-value;
-
-    <variablelist>
-      <varlistentry>
-	<term><errorcode>EINVAL</errorcode></term>
-	<listitem>
-	  <para>The driver does not support this ioctl.</para>
-	</listitem>
-      </varlistentry>
-    </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-overlay.xml b/Documentation/DocBook/media/v4l/vidioc-overlay.xml
index 1036c58..250a7de 100644
--- a/Documentation/DocBook/media/v4l/vidioc-overlay.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-overlay.xml
@@ -65,19 +65,10 @@
       <varlistentry>
 	<term><errorcode>EINVAL</errorcode></term>
 	<listitem>
-	  <para>Video overlay is not supported, or the
-parameters have not been set up. See <xref
+	  <para>The overlay parameters have not been set up. See <xref
 linkend="overlay" /> for the necessary steps.</para>
 	</listitem>
       </varlistentry>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-qbuf.xml b/Documentation/DocBook/media/v4l/vidioc-qbuf.xml
index f2b11f8..9caa49a 100644
--- a/Documentation/DocBook/media/v4l/vidioc-qbuf.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-qbuf.xml
@@ -158,15 +158,6 @@ or no buffers have been allocated yet, or the
 <structfield>userptr</structfield> or
 <structfield>length</structfield> are invalid.</para>
 	</listitem>
-      </varlistentry>
-      <varlistentry>
-	<term><errorcode>ENOMEM</errorcode></term>
-	<listitem>
-	  <para>Not enough physical or virtual memory was available to
-enqueue a user pointer buffer.</para>
-	</listitem>
-      </varlistentry>
-      <varlistentry>
 	<term><errorcode>EIO</errorcode></term>
 	<listitem>
 	  <para><constant>VIDIOC_DQBUF</constant> failed due to an
@@ -184,11 +175,3 @@ continue streaming.
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-query-dv-preset.xml b/Documentation/DocBook/media/v4l/vidioc-query-dv-preset.xml
index d272f7a..23b17f6 100644
--- a/Documentation/DocBook/media/v4l/vidioc-query-dv-preset.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-query-dv-preset.xml
@@ -61,27 +61,5 @@ returned.</para>
 
   <refsect1>
     &return-value;
-    <variablelist>
-      <varlistentry>
-	<term><errorcode>EINVAL</errorcode></term>
-	<listitem>
-	  <para>This ioctl is not supported.</para>
-	</listitem>
-    </varlistentry>
-      <varlistentry>
-	<term><errorcode>EBUSY</errorcode></term>
-	<listitem>
-	  <para>The device is busy and therefore can not sense the preset</para>
-	</listitem>
-      </varlistentry>
-    </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-querycap.xml b/Documentation/DocBook/media/v4l/vidioc-querycap.xml
index 7aa6973..e3664d6 100644
--- a/Documentation/DocBook/media/v4l/vidioc-querycap.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-querycap.xml
@@ -283,24 +283,5 @@ linkend="mmap">streaming</link> I/O method.</entry>
 
   <refsect1>
     &return-value;
-
-    <variablelist>
-      <varlistentry>
-	<term><errorcode>EINVAL</errorcode></term>
-	<listitem>
-	  <para>The device is not compatible with this
-specification.</para>
-	</listitem>
-      </varlistentry>
-    </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
-
diff --git a/Documentation/DocBook/media/v4l/vidioc-querystd.xml b/Documentation/DocBook/media/v4l/vidioc-querystd.xml
index 1a9e603..4b79c7c 100644
--- a/Documentation/DocBook/media/v4l/vidioc-querystd.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-querystd.xml
@@ -62,28 +62,5 @@ current video input or output.</para>
 
   <refsect1>
     &return-value;
-
-    <variablelist>
-      <varlistentry>
-	<term><errorcode>EINVAL</errorcode></term>
-	<listitem>
-	  <para>This ioctl is not supported.</para>
-	</listitem>
-      </varlistentry>
-      <varlistentry>
-	<term><errorcode>EBUSY</errorcode></term>
-	<listitem>
-	  <para>The device is busy and therefore can not detect the standard</para>
-	</listitem>
-      </varlistentry>
-    </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml b/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml
index 69800ae..7be4b1d 100644
--- a/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml
@@ -122,14 +122,6 @@ higher. This array should be zeroed by applications.</entry>
 
     <variablelist>
       <varlistentry>
-	<term><errorcode>EBUSY</errorcode></term>
-	<listitem>
-	  <para>The driver supports multiple opens and I/O is already
-in progress, or reallocation of buffers was attempted although one or
-more are still mapped.</para>
-	</listitem>
-      </varlistentry>
-      <varlistentry>
 	<term><errorcode>EINVAL</errorcode></term>
 	<listitem>
 	  <para>The buffer type (<structfield>type</structfield> field) or the
@@ -140,11 +132,3 @@ supported.</para>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-streamon.xml b/Documentation/DocBook/media/v4l/vidioc-streamon.xml
index 75ed39b..81cca45 100644
--- a/Documentation/DocBook/media/v4l/vidioc-streamon.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-streamon.xml
@@ -88,9 +88,9 @@ synchronize with other events.</para>
       <varlistentry>
 	<term><errorcode>EINVAL</errorcode></term>
 	<listitem>
-	  <para>Streaming I/O is not supported, the buffer
-<structfield>type</structfield> is not supported, or no buffers have
-been allocated (memory mapping) or enqueued (output) yet.</para>
+	  <para>The buffer<structfield>type</structfield> is not supported,
+	  or no buffers have been allocated (memory mapping) or enqueued
+	  (output) yet.</para>
 	</listitem>
       </varlistentry>
       <varlistentry>
@@ -105,11 +105,3 @@ been allocated (memory mapping) or enqueued (output) yet.</para>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-subdev-g-fmt.xml b/Documentation/DocBook/media/v4l/vidioc-subdev-g-fmt.xml
index f367c57..a67cde6 100644
--- a/Documentation/DocBook/media/v4l/vidioc-subdev-g-fmt.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-subdev-g-fmt.xml
@@ -177,4 +177,7 @@
       </varlistentry>
     </variablelist>
   </refsect1>
+  <refsect1>
+    &return-value;
+  </refsect1>
 </refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml b/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml
index 25471e8..69c0d8a 100644
--- a/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml
@@ -290,13 +290,8 @@
 	</tbody>
       </tgroup>
     </table>
-
+  </refsect1>
+  <refsect1>
+    &return-value;
   </refsect1>
 </refentry>
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH RFCv3 03/17] [media] DocBook: Use the generic error code page also for MC API
       [not found] <cover.1309974026.git.mchehab@redhat.com>
                   ` (2 preceding siblings ...)
  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 ` Mauro Carvalho Chehab
  2011-07-07 15:29   ` Hans Verkuil
  2011-07-06 18:03 ` [PATCH RFCv3 04/17] [media] DocBook/media-ioc-setup-link.xml: Remove EBUSY Mauro Carvalho Chehab
                   ` (12 subsequent siblings)
  16 siblings, 1 reply; 23+ messages in thread
From: Mauro Carvalho Chehab @ 2011-07-06 18:03 UTC (permalink / raw)
  Cc: Linux Media Mailing List, Linux Kernel Mailing List

Instead of having their own generic error codes at the MC API, move
its section to the generic one and be sure that all media ioctl's
will point to it.

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

diff --git a/Documentation/DocBook/media/v4l/gen-errors.xml b/Documentation/DocBook/media/v4l/gen-errors.xml
index 6ef476a..a7f73c9 100644
--- a/Documentation/DocBook/media/v4l/gen-errors.xml
+++ b/Documentation/DocBook/media/v4l/gen-errors.xml
@@ -5,6 +5,11 @@
   <tgroup cols="2">
     &cs-str;
     <tbody valign="top">
+	<!-- Keep it ordered alphabetically -->
+      <row>
+	<entry>EBADF</entry>
+	<entry><parameter>fd</parameter> is not a valid open file descriptor.</entry>
+      </row>
       <row>
 	<entry>EBUSY</entry>
 	<entry>The ioctl can't be handled because the device is busy. This is
@@ -15,7 +20,16 @@
 	       problem first (typically: stop the stream before retrying).</entry>
       </row>
       <row>
+	<entry>EFAULT</entry>
+	<entry><parameter>fd</parameter> is not a valid open file descriptor.</entry>
+      </row>
+      <row>
 	<entry>EINVAL</entry>
+	<entry>One or more of the ioctl parameters are invalid. This is a widely
+	       error code. see the individual ioctl requests for actual causes.</entry>
+      </row>
+      <row>
+	<entry>EINVAL or ENOTTY</entry>
 	<entry>The ioctl is not supported by the driver, actually meaning that
 	       the required functionality is not available.</entry>
       </row>
@@ -25,7 +39,7 @@
       </row>
       <row>
 	<entry>ENOSPC</entry>
-	<entry>On USB devices, the stream ioctl's can return this error meaning
+	<entry>On USB devices, the stream ioctl's can return this error, meaning
 	       that this request would overcommit the usb bandwidth reserved
 	       for periodic transfers (up to 80% of the USB bandwidth).</entry>
       </row>
diff --git a/Documentation/DocBook/media/v4l/media-func-ioctl.xml b/Documentation/DocBook/media/v4l/media-func-ioctl.xml
index bda8604..e0ee285 100644
--- a/Documentation/DocBook/media/v4l/media-func-ioctl.xml
+++ b/Documentation/DocBook/media/v4l/media-func-ioctl.xml
@@ -63,54 +63,10 @@
   </refsect1>
 
   <refsect1>
-    <title>Return Value</title>
-
-    <para><function>ioctl()</function> returns <returnvalue>0</returnvalue> on
-    success. On failure, <returnvalue>-1</returnvalue> is returned, and the
-    <varname>errno</varname> variable is set appropriately. Generic error codes
-    are listed below, and request-specific error codes are listed in the
+    &return-value;
+    <para>Request-specific error codes are listed in the
     individual requests descriptions.</para>
     <para>When an ioctl that takes an output or read/write parameter fails,
     the parameter remains unmodified.</para>
-
-    <variablelist>
-      <varlistentry>
-	<term><errorcode>EBADF</errorcode></term>
-	<listitem>
-	  <para><parameter>fd</parameter> is not a valid open file descriptor.
-	  </para>
-	</listitem>
-      </varlistentry>
-      <varlistentry>
-	<term><errorcode>EFAULT</errorcode></term>
-	<listitem>
-	  <para><parameter>argp</parameter> references an inaccessible memory
-	  area.</para>
-	</listitem>
-      </varlistentry>
-      <varlistentry>
-	<term><errorcode>EINVAL</errorcode></term>
-	<listitem>
-	  <para>The <parameter>request</parameter> or the data pointed to by
-	  <parameter>argp</parameter> is not valid. This is a very common error
-	  code, see the individual ioctl requests listed in
-	  <xref linkend="media-user-func" /> for actual causes.</para>
-	</listitem>
-      </varlistentry>
-      <varlistentry>
-	<term><errorcode>ENOMEM</errorcode></term>
-	<listitem>
-	  <para>Insufficient kernel memory was available to complete the
-	  request.</para>
-	</listitem>
-      </varlistentry>
-      <varlistentry>
-	<term><errorcode>ENOTTY</errorcode></term>
-	<listitem>
-	  <para><parameter>fd</parameter> is  not  associated  with  a character
-	  special device.</para>
-	</listitem>
-      </varlistentry>
-    </variablelist>
   </refsect1>
 </refentry>
diff --git a/Documentation/DocBook/media/v4l/media-ioc-device-info.xml b/Documentation/DocBook/media/v4l/media-ioc-device-info.xml
index 1f32373..2ce5214 100644
--- a/Documentation/DocBook/media/v4l/media-ioc-device-info.xml
+++ b/Documentation/DocBook/media/v4l/media-ioc-device-info.xml
@@ -127,7 +127,6 @@
   </refsect1>
 
   <refsect1>
-    <title>Return value</title>
-    <para>This function doesn't return specific error codes.</para>
+    &return-value;
   </refsect1>
 </refentry>
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH RFCv3 04/17] [media] DocBook/media-ioc-setup-link.xml: Remove EBUSY
       [not found] <cover.1309974026.git.mchehab@redhat.com>
                   ` (3 preceding siblings ...)
  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-06 18:03 ` Mauro Carvalho Chehab
  2011-07-06 18:03 ` [PATCH RFCv3 05/17] [media] DocBook: Remove V4L generic error description for ioctl() Mauro Carvalho Chehab
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 23+ messages in thread
From: Mauro Carvalho Chehab @ 2011-07-06 18:03 UTC (permalink / raw)
  Cc: Linux Media Mailing List, Linux Kernel Mailing List

The EBUSY is already described as a generic error condition, with a
similar text.

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

diff --git a/Documentation/DocBook/media/v4l/media-ioc-setup-link.xml b/Documentation/DocBook/media/v4l/media-ioc-setup-link.xml
index cec97af..fc2e522 100644
--- a/Documentation/DocBook/media/v4l/media-ioc-setup-link.xml
+++ b/Documentation/DocBook/media/v4l/media-ioc-setup-link.xml
@@ -72,15 +72,6 @@
 
     <variablelist>
       <varlistentry>
-	<term><errorcode>EBUSY</errorcode></term>
-	<listitem>
-	  <para>The link properties can't be changed because the link is
-	  currently busy. This can be caused, for instance, by an active media
-	  stream (audio or video) on the link. The ioctl shouldn't be retried if
-	  no other action is performed before to fix the problem.</para>
-	</listitem>
-      </varlistentry>
-      <varlistentry>
 	<term><errorcode>EINVAL</errorcode></term>
 	<listitem>
 	  <para>The &media-link-desc; references a non-existing link, or the
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH RFCv3 05/17] [media] DocBook: Remove V4L generic error description for ioctl()
       [not found] <cover.1309974026.git.mchehab@redhat.com>
                   ` (4 preceding siblings ...)
  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 ` 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
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 23+ messages in thread
From: Mauro Carvalho Chehab @ 2011-07-06 18:03 UTC (permalink / raw)
  Cc: Linux Media Mailing List, Linux Kernel Mailing List

V4L ioctl function descripton also has a generic error chapter.
Remove it, as it is now obsoleted by a general, multi-API generic
error descriptions.

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

diff --git a/Documentation/DocBook/media/v4l/func-ioctl.xml b/Documentation/DocBook/media/v4l/func-ioctl.xml
index b60fd37..2de64be 100644
--- a/Documentation/DocBook/media/v4l/func-ioctl.xml
+++ b/Documentation/DocBook/media/v4l/func-ioctl.xml
@@ -64,75 +64,9 @@ their respective function and parameters are specified in <xref
   </refsect1>
 
   <refsect1>
-    <title>Return Value</title>
-
-    <para>On success the <function>ioctl()</function> function returns
-<returnvalue>0</returnvalue> and does not reset the
-<varname>errno</varname> variable. On failure
-<returnvalue>-1</returnvalue> is returned, when the ioctl takes an
-output or read/write parameter it remains unmodified, and the
-<varname>errno</varname> variable is set appropriately. See below for
-possible error codes. Generic errors like <errorcode>EBADF</errorcode>
-or <errorcode>EFAULT</errorcode> are not listed in the sections
-discussing individual ioctl requests.</para>
-    <para>Note ioctls may return undefined error codes. Since errors
-may have side effects such as a driver reset applications should
-abort on unexpected errors.</para>
-
-    <variablelist>
-      <varlistentry>
-	<term><errorcode>EBADF</errorcode></term>
-	<listitem>
-	  <para><parameter>fd</parameter> is not a valid open file
-descriptor.</para>
-	</listitem>
-      </varlistentry>
-      <varlistentry>
-	<term><errorcode>EBUSY</errorcode></term>
-	<listitem>
-	  <para>The property cannot be changed right now. Typically
-this error code is returned when I/O is in progress or the driver
-supports multiple opens and another process locked the property.</para>
-	</listitem>
-      </varlistentry>
-      <varlistentry>
-	<term><errorcode>EFAULT</errorcode></term>
-	<listitem>
-	  <para><parameter>argp</parameter> references an inaccessible
-memory area.</para>
-	</listitem>
-      </varlistentry>
-      <varlistentry>
-	<term><errorcode>ENOTTY</errorcode></term>
-	<listitem>
-	  <para><parameter>fd</parameter> is  not  associated  with  a
-character special device.</para>
-	</listitem>
-      </varlistentry>
-      <varlistentry>
-	<term><errorcode>EINVAL</errorcode></term>
-	<listitem>
-	  <para>The <parameter>request</parameter> or the data pointed
-to by <parameter>argp</parameter> is not valid. This is a very common
-error code, see the individual ioctl requests listed in <xref
-	      linkend="user-func" /> for actual causes.</para>
-	</listitem>
-      </varlistentry>
-      <varlistentry>
-	<term><errorcode>ENOMEM</errorcode></term>
-	<listitem>
-	  <para>Not enough physical or virtual memory was available to
-complete the request.</para>
-	</listitem>
-      </varlistentry>
-      <varlistentry>
-	<term><errorcode>ERANGE</errorcode></term>
-	<listitem>
-	  <para>The application attempted to set a control with the
-&VIDIOC-S-CTRL; ioctl to a value which is out of bounds.</para>
-	</listitem>
-      </varlistentry>
-    </variablelist>
+    &return-value;
+    <para>When an ioctl that takes an output or read/write parameter fails,
+    the parameter remains unmodified.</para>
   </refsect1>
 </refentry>
 
diff --git a/Documentation/DocBook/media/v4l/gen-errors.xml b/Documentation/DocBook/media/v4l/gen-errors.xml
index a7f73c9..2b50b63 100644
--- a/Documentation/DocBook/media/v4l/gen-errors.xml
+++ b/Documentation/DocBook/media/v4l/gen-errors.xml
@@ -31,7 +31,8 @@
       <row>
 	<entry>EINVAL or ENOTTY</entry>
 	<entry>The ioctl is not supported by the driver, actually meaning that
-	       the required functionality is not available.</entry>
+	       the required functionality is not available, or the file
+	       descriptor is not for a media device.</entry>
       </row>
       <row>
 	<entry>ENOMEM</entry>
@@ -46,3 +47,10 @@
     </tbody>
   </tgroup>
 </table>
+
+<para>Note 1: ioctls may return other error codes. Since errors may have side
+effects such as a driver reset, applications should abort on unexpected errors.
+</para>
+
+<para>Note 2: Request-specific error codes are listed in the individual
+requests descriptions.</para>
diff --git a/Documentation/DocBook/media/v4l/media-func-ioctl.xml b/Documentation/DocBook/media/v4l/media-func-ioctl.xml
index e0ee285..39478d0 100644
--- a/Documentation/DocBook/media/v4l/media-func-ioctl.xml
+++ b/Documentation/DocBook/media/v4l/media-func-ioctl.xml
@@ -64,6 +64,7 @@
 
   <refsect1>
     &return-value;
+
     <para>Request-specific error codes are listed in the
     individual requests descriptions.</para>
     <para>When an ioctl that takes an output or read/write parameter fails,
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH RFCv3 06/17] [media] DocBook: Add an error code session for LIRC interface
       [not found] <cover.1309974026.git.mchehab@redhat.com>
                   ` (5 preceding siblings ...)
  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 ` 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
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 23+ messages in thread
From: Mauro Carvalho Chehab @ 2011-07-06 18:03 UTC (permalink / raw)
  Cc: Linux Media Mailing List, Linux Kernel Mailing List

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

diff --git a/Documentation/DocBook/media/v4l/lirc_device_interface.xml b/Documentation/DocBook/media/v4l/lirc_device_interface.xml
index 0e0453f..a060f3f 100644
--- a/Documentation/DocBook/media/v4l/lirc_device_interface.xml
+++ b/Documentation/DocBook/media/v4l/lirc_device_interface.xml
@@ -248,4 +248,8 @@ on working with the default settings initially.</para>
 </variablelist>
 
 </section>
+
+<section id="lirc_dev_errors">
+    &return-value;
+</section>
 </section>
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH RFCv3 07/17] [media] DocBook: Add return error codes to LIRC ioctl session
       [not found] <cover.1309974026.git.mchehab@redhat.com>
                   ` (6 preceding siblings ...)
  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 ` Mauro Carvalho Chehab
  2011-07-06 18:03 ` [PATCH RFCv3 10/17] [media] DVB: Point to the generic error chapter Mauro Carvalho Chehab
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 23+ messages in thread
From: Mauro Carvalho Chehab @ 2011-07-06 18:03 UTC (permalink / raw)
  Cc: Linux Media Mailing List, Linux Kernel Mailing List

Add a reference for the generic error code chapter to LIRC ioctl
description.

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

diff --git a/Documentation/DocBook/media/v4l/lirc_device_interface.xml b/Documentation/DocBook/media/v4l/lirc_device_interface.xml
index a060f3f..8d7eb6b 100644
--- a/Documentation/DocBook/media/v4l/lirc_device_interface.xml
+++ b/Documentation/DocBook/media/v4l/lirc_device_interface.xml
@@ -246,10 +246,8 @@ on working with the default settings initially.</para>
     </listitem>
   </varlistentry>
 </variablelist>
-
-</section>
-
 <section id="lirc_dev_errors">
-    &return-value;
+  &return-value;
+</section>
 </section>
 </section>
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH RFCv3 10/17] [media] DVB: Point to the generic error chapter
       [not found] <cover.1309974026.git.mchehab@redhat.com>
                   ` (7 preceding siblings ...)
  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 ` Mauro Carvalho Chehab
  2011-07-06 18:03 ` [PATCH RFCv3 11/17] [media] DocBook/audio.xml: Remove generic errors Mauro Carvalho Chehab
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 23+ messages in thread
From: Mauro Carvalho Chehab @ 2011-07-06 18:03 UTC (permalink / raw)
  Cc: Linux Media Mailing List, Linux Kernel Mailing List

Just like the V4L, MC and LIRC API's, point to the generic error
chapter for ioctl's. This will allow moving generic error codes
to just one place inside all media API's.

A latter patch will remove the generic errors from each specific
ioctl.

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

diff --git a/Documentation/DocBook/media/dvb/audio.xml b/Documentation/DocBook/media/dvb/audio.xml
index c27fe73..90e9b7f 100644
--- a/Documentation/DocBook/media/dvb/audio.xml
+++ b/Documentation/DocBook/media/dvb/audio.xml
@@ -220,8 +220,7 @@ and right.
 <para>(blocking mode is the default)</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+<para>RETURN VALUE</para>
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>ENODEV</para>
@@ -279,8 +278,7 @@ and right.
 <para>File descriptor returned by a previous call to open().</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+<para>RETURN VALUE</para>
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -335,8 +333,7 @@ and right.
 <para>Size of buf.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+<para>RETURN VALUE</para>
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EPERM</para>
@@ -394,8 +391,7 @@ role="subsection"><title>AUDIO_STOP</title>
 <para>Equals AUDIO_STOP for this command.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -446,8 +442,7 @@ role="subsection"><title>AUDIO_PLAY</title>
 <para>Equals AUDIO_PLAY for this command.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -506,8 +501,7 @@ role="subsection"><title>AUDIO_PAUSE</title>
 <para>Equals AUDIO_PAUSE for this command.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -563,8 +557,7 @@ with AUDIO_PAUSE command.</para>
 <para>Equals AUDIO_CONTINUE for this command.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -627,8 +620,7 @@ role="subsection"><title>AUDIO_SELECT_SOURCE</title>
  stream.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -706,8 +698,7 @@ role="subsection"><title>AUDIO_SET_MUTE</title>
 <para>FALSE Audio Un-mute</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -785,8 +776,7 @@ role="subsection"><title>AUDIO_SET_AV_SYNC</title>
 <para>FALSE AV-sync OFF</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -868,8 +858,7 @@ role="subsection"><title>AUDIO_SET_BYPASS_MODE</title>
 <para>FALSE Bypass is enabled</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -937,8 +926,7 @@ role="subsection"><title>AUDIO_CHANNEL_SELECT</title>
  stereo).</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1005,8 +993,7 @@ role="subsection"><title>AUDIO_GET_STATUS</title>
 <para>Returns the current state of Audio Device.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1073,8 +1060,7 @@ role="subsection"><title>AUDIO_GET_CAPABILITIES</title>
 <para>Returns a bit array of supported sound formats.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1132,8 +1118,7 @@ role="subsection"><title>AUDIO_CLEAR_BUFFER</title>
 <para>Equals AUDIO_CLEAR_BUFFER for this command.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1196,8 +1181,7 @@ role="subsection"><title>AUDIO_SET_ID</title>
 <para>audio sub-stream id</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1262,8 +1246,7 @@ role="subsection"><title>AUDIO_SET_MIXER</title>
 <para>mixer settings.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1330,8 +1313,7 @@ role="subsection"><title>AUDIO_SET_STREAMTYPE</title>
 <para>stream type</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1390,8 +1372,7 @@ role="subsection"><title>AUDIO_SET_EXT_ID</title>
 <para>audio sub_stream_id</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1451,8 +1432,7 @@ role="subsection"><title>AUDIO_SET_ATTRIBUTES</title>
 <para>audio attributes according to section ??</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1512,8 +1492,7 @@ role="subsection"><title>AUDIO_SET_KARAOKE</title>
 <para>karaoke settings according to section ??.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
diff --git a/Documentation/DocBook/media/dvb/ca.xml b/Documentation/DocBook/media/dvb/ca.xml
index a6cb952..5c4adb4 100644
--- a/Documentation/DocBook/media/dvb/ca.xml
+++ b/Documentation/DocBook/media/dvb/ca.xml
@@ -158,8 +158,7 @@ typedef struct ca_pid {
 <para>(blocking mode is the default)</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+<para>RETURN VALUE</para>
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>ENODEV</para>
@@ -217,8 +216,7 @@ typedef struct ca_pid {
 <para>File descriptor returned by a previous call to open().</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+<para>RETURN VALUE</para>
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
diff --git a/Documentation/DocBook/media/dvb/demux.xml b/Documentation/DocBook/media/dvb/demux.xml
index 6758739..e5058d7 100644
--- a/Documentation/DocBook/media/dvb/demux.xml
+++ b/Documentation/DocBook/media/dvb/demux.xml
@@ -239,8 +239,7 @@ typedef enum {
 <para>(blocking mode is the default)</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+<para>RETURN VALUE</para>
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>ENODEV</para>
@@ -299,8 +298,7 @@ typedef enum {
 <para>File descriptor returned by a previous call to open().</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+<para>RETURN VALUE</para>
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -381,8 +379,7 @@ typedef enum {
 <para>Size of buf.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+<para>RETURN VALUE</para>
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EWOULDBLOCK</para>
@@ -485,8 +482,7 @@ typedef enum {
 <para>Size of buf.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+<para>RETURN VALUE</para>
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EWOULDBLOCK</para>
@@ -553,8 +549,7 @@ typedef enum {
 <para>Equals DMX_START for this command.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -619,8 +614,7 @@ typedef enum {
 <para>Equals DMX_STOP for this command.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -682,8 +676,7 @@ typedef enum {
 <para>Pointer to structure containing filter parameters.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -755,8 +748,7 @@ typedef enum {
 <para>Pointer to structure containing filter parameters.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -827,8 +819,7 @@ typedef enum {
 <para>Size of circular buffer.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -900,8 +891,7 @@ typedef enum {
 <para>Pointer to the location where the event is to be stored.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -974,8 +964,7 @@ typedef enum {
 <para>Pointer to the location where the stc is to be stored.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
diff --git a/Documentation/DocBook/media/dvb/dvbproperty.xml b/Documentation/DocBook/media/dvb/dvbproperty.xml
index caec58c..33274bc 100644
--- a/Documentation/DocBook/media/dvb/dvbproperty.xml
+++ b/Documentation/DocBook/media/dvb/dvbproperty.xml
@@ -80,7 +80,7 @@ struct dtv_properties {
 <para>Points to the location where the front-end property commands are stored.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row>
   <entry align="char"><para>EINVAL</para></entry>
   <entry align="char"><para>Invalid parameter(s) received or number of parameters out of the range.</para></entry>
@@ -137,8 +137,7 @@ struct dtv_properties {
 <para>Points to the location where the front-end property commands are stored.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row>
   <entry align="char"><para>EINVAL</para></entry>
   <entry align="char"><para>Invalid parameter(s) received or number of parameters out of the range.</para></entry>
diff --git a/Documentation/DocBook/media/dvb/frontend.xml b/Documentation/DocBook/media/dvb/frontend.xml
index 304d54e..c5a5cb4 100644
--- a/Documentation/DocBook/media/dvb/frontend.xml
+++ b/Documentation/DocBook/media/dvb/frontend.xml
@@ -515,8 +515,7 @@ typedef enum fe_hierarchy {
 <para>(blocking mode is the default)</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+<para>RETURN VALUE</para>
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>ENODEV</para>
@@ -576,8 +575,7 @@ typedef enum fe_hierarchy {
 <para>File descriptor returned by a previous call to open().</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -633,8 +631,7 @@ typedef enum fe_hierarchy {
  to be stored.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+<para>RETURN VALUE</para>
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -695,8 +692,7 @@ typedef enum fe_hierarchy {
 <para>The bit error rate is stored into *ber.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -773,8 +769,7 @@ typedef enum fe_hierarchy {
 </entry>
  </row></tbody></tgroup></informaltable>
 
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -851,8 +846,7 @@ typedef enum fe_hierarchy {
 <para>The signal strength value is stored into *strength.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -936,8 +930,7 @@ typedef enum fe_hierarchy {
  so far.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1012,8 +1005,7 @@ typedef enum fe_hierarchy {
 <para>Points to parameters for tuning operation.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1085,8 +1077,7 @@ typedef enum fe_hierarchy {
 </entry>
  </row></tbody></tgroup></informaltable>
 
-<para>ERRORS
-</para>
+&return-value-dvb;
 
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
@@ -1187,8 +1178,7 @@ typedef enum fe_hierarchy {
 </entry>
  </row></tbody></tgroup></informaltable>
 
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1273,8 +1263,7 @@ typedef enum fe_hierarchy {
  to be stored.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1332,8 +1321,7 @@ typedef enum fe_hierarchy {
 </entry>
  </row></tbody></tgroup></informaltable>
 
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1405,8 +1393,7 @@ typedef enum fe_hierarchy {
 </entry>
  </row></tbody></tgroup></informaltable>
 
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1493,8 +1480,7 @@ typedef enum fe_hierarchy {
 <para>Pointer to the command to be received.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1579,8 +1565,7 @@ typedef enum fe_hierarchy {
 </entry>
  </row></tbody></tgroup></informaltable>
 
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1663,8 +1648,7 @@ typedef enum fe_hierarchy {
 <para>The requested tone generation mode (on/off).</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>ENODEV</para>
@@ -1748,8 +1732,7 @@ typedef enum fe_hierarchy {
 </entry>
  </row></tbody></tgroup></informaltable>
 
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>ENODEV</para>
@@ -1834,8 +1817,7 @@ typedef enum fe_hierarchy {
 </entry>
  </row></tbody></tgroup></informaltable>
 
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>ENODEV</para>
@@ -1903,7 +1885,7 @@ FE_TUNE_MODE_ONESHOT When set, this flag will disable any zigzagging or other "n
 </entry>
  </row></tbody></tgroup></informaltable>
 
-<para>ERRORS</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row>
 <entry align="char"><para>EINVAL</para></entry>
 <entry align="char"><para>Invalid argument.</para></entry>
@@ -1941,7 +1923,7 @@ sends the specified raw cmd to the dish via DISEqC.
 </entry>
  </row></tbody></tgroup></informaltable>
 
-<para>ERRORS</para>
+&return-value-dvb;
 <informaltable><tgroup cols="1"><tbody><row>
 <entry align="char">
 	<para>There are no errors in use for this call</para>
diff --git a/Documentation/DocBook/media/dvb/video.xml b/Documentation/DocBook/media/dvb/video.xml
index 539c79b..0b1b662 100644
--- a/Documentation/DocBook/media/dvb/video.xml
+++ b/Documentation/DocBook/media/dvb/video.xml
@@ -399,8 +399,7 @@ VIDEO_GET_NAVI:
 <para>(blocking mode is the default)</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+<para>RETURN VALUE</para>
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>ENODEV</para>
@@ -458,8 +457,7 @@ VIDEO_GET_NAVI:
 <para>File descriptor returned by a previous call to open().</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+<para>RETURN VALUE</para>
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -514,8 +512,7 @@ VIDEO_GET_NAVI:
 <para>Size of buf.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+<para>RETURN VALUE</para>
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EPERM</para>
@@ -595,8 +592,7 @@ role="subsection"><title>VIDEO_STOP</title>
 <para>FALSE: Show last decoded frame.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -648,8 +644,7 @@ role="subsection"><title>VIDEO_PLAY</title>
 <para>Equals VIDEO_PLAY for this command.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -705,8 +700,7 @@ role="subsection"><title>VIDEO_FREEZE</title>
 <para>Equals VIDEO_FREEZE for this command.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -758,8 +752,7 @@ role="subsection"><title>VIDEO_CONTINUE</title>
 <para>Equals VIDEO_CONTINUE for this command.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -821,8 +814,7 @@ role="subsection"><title>VIDEO_SELECT_SOURCE</title>
 <para>Indicates which source shall be used for the Video stream.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -887,8 +879,7 @@ role="subsection"><title>VIDEO_SET_BLANK</title>
 <para>FALSE: Show last decoded frame.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -955,8 +946,7 @@ role="subsection"><title>VIDEO_GET_STATUS</title>
 <para>Returns the current status of the Video Device.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1032,8 +1022,7 @@ role="subsection"><title>VIDEO_GET_EVENT</title>
  stored.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1115,8 +1104,7 @@ role="subsection"><title>VIDEO_SET_DISPLAY_FORMAT</title>
 <para>Selects the video format to be used.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1185,8 +1173,7 @@ role="subsection"><title>VIDEO_STILLPICTURE</title>
 <para>Pointer to a location where an I-frame and size is stored.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1252,8 +1239,7 @@ role="subsection"><title>VIDEO_FAST_FORWARD</title>
 <para>The number of frames to skip.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1326,8 +1312,7 @@ role="subsection"><title>VIDEO_SLOWMOTION</title>
 <para>The number of times to repeat each frame.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1402,8 +1387,7 @@ role="subsection"><title>VIDEO_GET_CAPABILITIES</title>
  information.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1462,8 +1446,7 @@ role="subsection"><title>VIDEO_SET_ID</title>
 <para>video sub-stream id</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1520,8 +1503,7 @@ role="subsection"><title>VIDEO_CLEAR_BUFFER</title>
 <para>Equals VIDEO_CLEAR_BUFFER for this command.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1574,8 +1556,7 @@ role="subsection"><title>VIDEO_SET_STREAMTYPE</title>
 <para>stream type</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1635,8 +1616,7 @@ role="subsection"><title>VIDEO_SET_FORMAT</title>
 <para>video format of TV as defined in section ??.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1697,8 +1677,7 @@ role="subsection"><title>VIDEO_SET_SYSTEM</title>
 <para>video system of TV output.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1757,8 +1736,7 @@ role="subsection"><title>VIDEO_SET_HIGHLIGHT</title>
 <para>SPU Highlight information according to section ??.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1818,8 +1796,7 @@ role="subsection"><title>VIDEO_SET_SPU</title>
  to section ??.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1879,8 +1856,7 @@ role="subsection"><title>VIDEO_SET_SPU_PALETTE</title>
 <para>SPU palette according to section ??.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -1941,8 +1917,7 @@ role="subsection"><title>VIDEO_GET_NAVI</title>
  ??.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -2003,8 +1978,7 @@ role="subsection"><title>VIDEO_SET_ATTRIBUTES</title>
 <para>video attributes according to section ??.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-<para>ERRORS
-</para>
+&return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
diff --git a/Documentation/DocBook/media_api.tmpl b/Documentation/DocBook/media_api.tmpl
index bdb06bc..c3eeca7 100644
--- a/Documentation/DocBook/media_api.tmpl
+++ b/Documentation/DocBook/media_api.tmpl
@@ -9,6 +9,7 @@
 <!ENTITY fd                     "File descriptor returned by <link linkend='func-open'><function>open()</function></link>.">
 <!ENTITY i2c                    "I<superscript>2</superscript>C">
 <!ENTITY return-value		"<title>Return Value</title><para>On success <returnvalue>0</returnvalue> is returned, on error <returnvalue>-1</returnvalue> and the <varname>errno</varname> variable is set appropriately. The generic error codes are described at the <link linkend='gen-errors'>Generic Error Codes</link> chapter.</para>">
+<!ENTITY return-value-dvb	"<para>RETURN VALUE</para><para>On success <returnvalue>0</returnvalue> is returned, on error <returnvalue>-1</returnvalue> and the <varname>errno</varname> variable is set appropriately. The generic error codes are described at the <link linkend='gen-errors'>Generic Error Codes</link> chapter.</para>">
 <!ENTITY manvol                 "<manvolnum>2</manvolnum>">
 
 <!-- Table templates: structs, structs w/union, defines. -->
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH RFCv3 11/17] [media] DocBook/audio.xml: Remove generic errors
       [not found] <cover.1309974026.git.mchehab@redhat.com>
                   ` (8 preceding siblings ...)
  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 ` Mauro Carvalho Chehab
  2011-07-06 18:03 ` [PATCH RFCv3 12/17] [media] DocBook/demux.xml: " Mauro Carvalho Chehab
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 23+ messages in thread
From: Mauro Carvalho Chehab @ 2011-07-06 18:03 UTC (permalink / raw)
  Cc: Linux Media Mailing List, Linux Kernel Mailing List

Remove generic errors from ioctl() descriptions. For other ioctl's,
there's no generic section. So, just keep whatever is there.
Also remove the EINTERNAL error code, as no DVB driver returns
it, and this error code is not defined on POSIX or on Linux.

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

diff --git a/Documentation/DocBook/media/dvb/audio.xml b/Documentation/DocBook/media/dvb/audio.xml
index 90e9b7f..d643862 100644
--- a/Documentation/DocBook/media/dvb/audio.xml
+++ b/Documentation/DocBook/media/dvb/audio.xml
@@ -230,13 +230,6 @@ and right.
 </entry>
  </row><row><entry
  align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error.</para>
-</entry>
- </row><row><entry
- align="char">
 <para>EBUSY</para>
 </entry><entry
  align="char">
@@ -392,21 +385,6 @@ role="subsection"><title>AUDIO_STOP</title>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 
 </section><section id="AUDIO_PLAY"
 role="subsection"><title>AUDIO_PLAY</title>
@@ -443,21 +421,6 @@ role="subsection"><title>AUDIO_PLAY</title>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 
 </section><section id="AUDIO_PAUSE"
 role="subsection"><title>AUDIO_PAUSE</title>
@@ -502,22 +465,6 @@ role="subsection"><title>AUDIO_PAUSE</title>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
-
 
 </section><section id="AUDIO_CONTINUE"
 role="subsection"><title>AUDIO_CONTINUE</title>
@@ -558,21 +505,6 @@ with AUDIO_PAUSE command.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 
 </section><section id="AUDIO_SELECT_SOURCE"
 role="subsection"><title>AUDIO_SELECT_SOURCE</title>
@@ -621,28 +553,6 @@ role="subsection"><title>AUDIO_SELECT_SOURCE</title>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINVAL</para>
-</entry><entry
- align="char">
-<para>Illegal input parameter.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 
 </section><section id="AUDIO_SET_MUTE"
 role="subsection"><title>AUDIO_SET_MUTE</title>
@@ -699,28 +609,6 @@ role="subsection"><title>AUDIO_SET_MUTE</title>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINVAL</para>
-</entry><entry
- align="char">
-<para>Illegal input parameter.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 
 </section><section id="AUDIO_SET_AV_SYNC"
 role="subsection"><title>AUDIO_SET_AV_SYNC</title>
@@ -777,28 +665,6 @@ role="subsection"><title>AUDIO_SET_AV_SYNC</title>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINVAL</para>
-</entry><entry
- align="char">
-<para>Illegal input parameter.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 
 </section><section id="AUDIO_SET_BYPASS_MODE"
 role="subsection"><title>AUDIO_SET_BYPASS_MODE</title>
@@ -859,28 +725,6 @@ role="subsection"><title>AUDIO_SET_BYPASS_MODE</title>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINVAL</para>
-</entry><entry
- align="char">
-<para>Illegal input parameter.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 
 </section><section id="AUDIO_CHANNEL_SELECT"
 role="subsection"><title>AUDIO_CHANNEL_SELECT</title>
@@ -927,28 +771,6 @@ role="subsection"><title>AUDIO_CHANNEL_SELECT</title>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINVAL</para>
-</entry><entry
- align="char">
-<para>Illegal input parameter ch.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 
 </section><section id="AUDIO_GET_STATUS"
 role="subsection"><title>AUDIO_GET_STATUS</title>
@@ -994,28 +816,6 @@ role="subsection"><title>AUDIO_GET_STATUS</title>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EFAULT</para>
-</entry><entry
- align="char">
-<para>status points to invalid address.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 
 </section><section id="AUDIO_GET_CAPABILITIES"
 role="subsection"><title>AUDIO_GET_CAPABILITIES</title>
@@ -1061,28 +861,6 @@ role="subsection"><title>AUDIO_GET_CAPABILITIES</title>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EFAULT</para>
-</entry><entry
- align="char">
-<para>cap points to an invalid address.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 
 </section><section id="AUDIO_CLEAR_BUFFER"
 role="subsection"><title>AUDIO_CLEAR_BUFFER</title>
@@ -1119,21 +897,6 @@ role="subsection"><title>AUDIO_CLEAR_BUFFER</title>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 
 </section><section id="AUDIO_SET_ID"
 role="subsection"><title>AUDIO_SET_ID</title>
@@ -1182,28 +945,6 @@ role="subsection"><title>AUDIO_SET_ID</title>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINVAL</para>
-</entry><entry
- align="char">
-<para>Invalid sub-stream id.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 
 </section><section id="AUDIO_SET_MIXER"
 role="subsection"><title>AUDIO_SET_MIXER</title>
@@ -1247,28 +988,6 @@ role="subsection"><title>AUDIO_SET_MIXER</title>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EFAULT</para>
-</entry><entry
- align="char">
-<para>mix points to an invalid address.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 
 </section><section id="AUDIO_SET_STREAMTYPE"
 role="subsection"><title>AUDIO_SET_STREAMTYPE</title>
@@ -1316,13 +1035,6 @@ role="subsection"><title>AUDIO_SET_STREAMTYPE</title>
 &return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row><row><entry
- align="char">
 <para>EINVAL</para>
 </entry><entry
  align="char">
@@ -1375,13 +1087,6 @@ role="subsection"><title>AUDIO_SET_EXT_ID</title>
 &return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row><row><entry
- align="char">
 <para>EINVAL</para>
 </entry><entry
  align="char">
@@ -1435,13 +1140,6 @@ role="subsection"><title>AUDIO_SET_ATTRIBUTES</title>
 &return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row><row><entry
- align="char">
 <para>EINVAL</para>
 </entry><entry
  align="char">
@@ -1495,13 +1193,6 @@ role="subsection"><title>AUDIO_SET_KARAOKE</title>
 &return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row><row><entry
- align="char">
 <para>EINVAL</para>
 </entry><entry
  align="char">
diff --git a/Documentation/DocBook/media/v4l/gen-errors.xml b/Documentation/DocBook/media/v4l/gen-errors.xml
index 2b50b63..9a9575f 100644
--- a/Documentation/DocBook/media/v4l/gen-errors.xml
+++ b/Documentation/DocBook/media/v4l/gen-errors.xml
@@ -35,6 +35,10 @@
 	       descriptor is not for a media device.</entry>
       </row>
       <row>
+        <entry>ENODEV</entry>
+	<entry>Device not found or was removed.</entry>
+      </row>
+      <row>
 	<entry>ENOMEM</entry>
 	<entry>There's not enough memory to handle the desired operation.</entry>
       </row>
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH RFCv3 12/17] [media] DocBook/demux.xml: Remove generic errors
       [not found] <cover.1309974026.git.mchehab@redhat.com>
                   ` (9 preceding siblings ...)
  2011-07-06 18:03 ` [PATCH RFCv3 11/17] [media] DocBook/audio.xml: Remove generic errors Mauro Carvalho Chehab
@ 2011-07-06 18:03 ` Mauro Carvalho Chehab
  2011-07-06 18:03 ` [PATCH RFCv3 09/17] [media] nxt6000: i2c bus error should return -EIO Mauro Carvalho Chehab
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 23+ messages in thread
From: Mauro Carvalho Chehab @ 2011-07-06 18:03 UTC (permalink / raw)
  Cc: Linux Media Mailing List, Linux Kernel Mailing List

Remove generic errors from ioctl() descriptions. For other ioctl's,
there's no generic section. So, just keep whatever is there.

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

diff --git a/Documentation/DocBook/media/dvb/demux.xml b/Documentation/DocBook/media/dvb/demux.xml
index e5058d7..37c1790 100644
--- a/Documentation/DocBook/media/dvb/demux.xml
+++ b/Documentation/DocBook/media/dvb/demux.xml
@@ -552,13 +552,6 @@ typedef enum {
 &return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
 <para>EINVAL</para>
 </entry><entry
  align="char">
@@ -615,14 +608,6 @@ typedef enum {
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid file descriptor.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 </section>
 
 <section id="DMX_SET_FILTER">
@@ -677,21 +662,6 @@ typedef enum {
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINVAL</para>
-</entry><entry
- align="char">
-<para>Invalid argument.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 </section>
 
 <section id="DMX_SET_PES_FILTER">
@@ -751,20 +721,6 @@ typedef enum {
 &return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINVAL</para>
-</entry><entry
- align="char">
-<para>Invalid argument.</para>
-</entry>
- </row><row><entry
- align="char">
 <para>EBUSY</para>
 </entry><entry
  align="char">
@@ -820,22 +776,6 @@ typedef enum {
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>ENOMEM</para>
-</entry><entry
- align="char">
-<para>The driver was not able to allocate a buffer of the
- requested size.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 </section>
 
 <section id="DMX_GET_EVENT">
@@ -894,20 +834,6 @@ typedef enum {
 &return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EFAULT</para>
-</entry><entry
- align="char">
-<para>ev points to an invalid address.</para>
-</entry>
- </row><row><entry
- align="char">
 <para>EWOULDBLOCK</para>
 </entry><entry
  align="char">
@@ -967,20 +893,6 @@ typedef enum {
 &return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EFAULT</para>
-</entry><entry
- align="char">
-<para>stc points to an invalid address.</para>
-</entry>
- </row><row><entry
- align="char">
 <para>EINVAL</para>
 </entry><entry
  align="char">
diff --git a/Documentation/DocBook/media/v4l/gen-errors.xml b/Documentation/DocBook/media/v4l/gen-errors.xml
index 9a9575f..3e6ddd9 100644
--- a/Documentation/DocBook/media/v4l/gen-errors.xml
+++ b/Documentation/DocBook/media/v4l/gen-errors.xml
@@ -48,6 +48,11 @@
 	       that this request would overcommit the usb bandwidth reserved
 	       for periodic transfers (up to 80% of the USB bandwidth).</entry>
       </row>
+      <row>
+	<entry>EWOULDBLOCK</entry>
+	<entry>Operation would block. Used when the ioctl would need to wait
+	       for an event, but the device was opened in non-blocking mode.</entry>
+      </row>
     </tbody>
   </tgroup>
 </table>
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH RFCv3 09/17] [media] nxt6000: i2c bus error should return -EIO
       [not found] <cover.1309974026.git.mchehab@redhat.com>
                   ` (10 preceding siblings ...)
  2011-07-06 18:03 ` [PATCH RFCv3 12/17] [media] DocBook/demux.xml: " Mauro Carvalho Chehab
@ 2011-07-06 18:03 ` 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
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 23+ messages in thread
From: Mauro Carvalho Chehab @ 2011-07-06 18:03 UTC (permalink / raw)
  Cc: Linux Media Mailing List, Linux Kernel Mailing List

-EFAULT is used to indicate that there were a problem when copying
data from/to userspace. Don't mix it with I2C bus error (-EIO).

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

diff --git a/drivers/media/dvb/frontends/nxt6000.c b/drivers/media/dvb/frontends/nxt6000.c
index a763ec7..6599b8f 100644
--- a/drivers/media/dvb/frontends/nxt6000.c
+++ b/drivers/media/dvb/frontends/nxt6000.c
@@ -50,7 +50,7 @@ static int nxt6000_writereg(struct nxt6000_state* state, u8 reg, u8 data)
 	if ((ret = i2c_transfer(state->i2c, &msg, 1)) != 1)
 		dprintk("nxt6000: nxt6000_write error (reg: 0x%02X, data: 0x%02X, ret: %d)\n", reg, data, ret);
 
-	return (ret != 1) ? -EFAULT : 0;
+	return (ret != 1) ? -EIO : 0;
 }
 
 static u8 nxt6000_readreg(struct nxt6000_state* state, u8 reg)
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH RFCv3 13/17] [media] dvb-bt8xx: Don't return -EFAULT when a device is not found
       [not found] <cover.1309974026.git.mchehab@redhat.com>
                   ` (11 preceding siblings ...)
  2011-07-06 18:03 ` [PATCH RFCv3 09/17] [media] nxt6000: i2c bus error should return -EIO Mauro Carvalho Chehab
@ 2011-07-06 18:03 ` Mauro Carvalho Chehab
  2011-07-06 18:04 ` [PATCH RFCv3 08/17] [media] siano: bad parameter is -EINVAL and not -EFAULT Mauro Carvalho Chehab
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 23+ messages in thread
From: Mauro Carvalho Chehab @ 2011-07-06 18:03 UTC (permalink / raw)
  Cc: Linux Media Mailing List, Linux Kernel Mailing List

When a device (or their PCI structs) are not found, the error should
be -ENODEV. -EFAULT is reserved for errors while copying arguments
from/to userspace.

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

diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
index 1e1106d..521d691 100644
--- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -892,7 +892,7 @@ static int __devinit dvb_bt8xx_probe(struct bttv_sub_device *sub)
 	if (!(bttv_pci_dev = bttv_get_pcidev(card->bttv_nr))) {
 		printk("dvb_bt8xx: no pci device for card %d\n", card->bttv_nr);
 		kfree(card);
-		return -EFAULT;
+		return -ENODEV;
 	}
 
 	if (!(card->bt = dvb_bt8xx_878_match(card->bttv_nr, bttv_pci_dev))) {
@@ -902,7 +902,7 @@ static int __devinit dvb_bt8xx_probe(struct bttv_sub_device *sub)
 		       "installed, try removing it.\n");
 
 		kfree(card);
-		return -EFAULT;
+		return -ENODEV;
 	}
 
 	mutex_init(&card->bt->gpio_lock);
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH RFCv3 08/17] [media] siano: bad parameter is -EINVAL and not -EFAULT
       [not found] <cover.1309974026.git.mchehab@redhat.com>
                   ` (12 preceding siblings ...)
  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:04 ` 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
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 23+ messages in thread
From: Mauro Carvalho Chehab @ 2011-07-06 18:04 UTC (permalink / raw)
  Cc: Linux Media Mailing List, Linux Kernel Mailing List

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

diff --git a/drivers/media/dvb/siano/smscoreapi.c b/drivers/media/dvb/siano/smscoreapi.c
index 78765ed..7331e84 100644
--- a/drivers/media/dvb/siano/smscoreapi.c
+++ b/drivers/media/dvb/siano/smscoreapi.c
@@ -1147,7 +1147,7 @@ static int smscore_validate_client(struct smscore_device_t *coredev,
 
 	if (!client) {
 		sms_err("bad parameter.");
-		return -EFAULT;
+		return -EINVAL;
 	}
 	registered_client = smscore_find_client(coredev, data_type, id);
 	if (registered_client == client)
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH RFCv3 14/17] [media] DocBook/dvb: Use generic descriptions for the frontend API
       [not found] <cover.1309974026.git.mchehab@redhat.com>
                   ` (13 preceding siblings ...)
  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 ` 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
  16 siblings, 0 replies; 23+ messages in thread
From: Mauro Carvalho Chehab @ 2011-07-06 18:04 UTC (permalink / raw)
  Cc: Linux Media Mailing List, Linux Kernel Mailing List

Move generic stuff into gen-errors.xml, and remove them from
DVB API. While here, removes two bogus error codes that aren't
supported or used on Linux: EINTERNAL and ENOSIGNAL.

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

diff --git a/Documentation/DocBook/media/dvb/dvbproperty.xml b/Documentation/DocBook/media/dvb/dvbproperty.xml
index 33274bc..207e1a5 100644
--- a/Documentation/DocBook/media/dvb/dvbproperty.xml
+++ b/Documentation/DocBook/media/dvb/dvbproperty.xml
@@ -82,15 +82,6 @@ struct dtv_properties {
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row>
-  <entry align="char"><para>EINVAL</para></entry>
-  <entry align="char"><para>Invalid parameter(s) received or number of parameters out of the range.</para></entry>
- </row><row>
-  <entry align="char"><para>ENOMEM</para></entry>
-  <entry align="char"><para>Out of memory.</para></entry>
- </row><row>
-  <entry align="char"><para>EFAULT</para></entry>
-  <entry align="char"><para>Failure while copying data from/to userspace.</para></entry>
- </row><row>
   <entry align="char"><para>EOPNOTSUPP</para></entry>
   <entry align="char"><para>Property type not supported.</para></entry>
  </row></tbody></tgroup></informaltable>
@@ -139,15 +130,6 @@ struct dtv_properties {
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row>
-  <entry align="char"><para>EINVAL</para></entry>
-  <entry align="char"><para>Invalid parameter(s) received or number of parameters out of the range.</para></entry>
- </row><row>
-  <entry align="char"><para>ENOMEM</para></entry>
-  <entry align="char"><para>Out of memory.</para></entry>
- </row><row>
-  <entry align="char"><para>EFAULT</para></entry>
-  <entry align="char"><para>Failure while copying data from/to userspace.</para></entry>
- </row><row>
   <entry align="char"><para>EOPNOTSUPP</para></entry>
   <entry align="char"><para>Property type not supported.</para></entry>
  </row></tbody></tgroup></informaltable>
diff --git a/Documentation/DocBook/media/dvb/frontend.xml b/Documentation/DocBook/media/dvb/frontend.xml
index c5a5cb4..61407ea 100644
--- a/Documentation/DocBook/media/dvb/frontend.xml
+++ b/Documentation/DocBook/media/dvb/frontend.xml
@@ -575,7 +575,7 @@ typedef enum fe_hierarchy {
 <para>File descriptor returned by a previous call to open().</para>
 </entry>
  </row></tbody></tgroup></informaltable>
-&return-value-dvb;
+<para>RETURN VALUE</para>
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
 <para>EBADF</para>
@@ -692,37 +692,8 @@ typedef enum fe_hierarchy {
 <para>The bit error rate is stored into *ber.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
+
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EFAULT</para>
-</entry><entry
- align="char">
-<para>ber points to invalid address.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>ENOSIGNAL</para>
-</entry><entry
- align="char">
-<para>There is no signal, thus no meaningful bit error rate. Also
- returned if the front-end is not turned on.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>ENOSYS</para>
-</entry><entry
- align="char">
-<para>Function not available for this device.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 </section>
 
 <section id="FE_READ_SNR">
@@ -770,36 +741,6 @@ typedef enum fe_hierarchy {
  </row></tbody></tgroup></informaltable>
 
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EFAULT</para>
-</entry><entry
- align="char">
-<para>snr points to invalid address.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>ENOSIGNAL</para>
-</entry><entry
- align="char">
-<para>There is no signal, thus no meaningful signal strength
- value. Also returned if front-end is not turned on.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>ENOSYS</para>
-</entry><entry
- align="char">
-<para>Function not available for this device.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 </section>
 
 <section id="FE_READ_SIGNAL_STRENGTH">
@@ -846,37 +787,8 @@ typedef enum fe_hierarchy {
 <para>The signal strength value is stored into *strength.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
+
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EFAULT</para>
-</entry><entry
- align="char">
-<para>status points to invalid address.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>ENOSIGNAL</para>
-</entry><entry
- align="char">
-<para>There is no signal, thus no meaningful signal strength
- value. Also returned if front-end is not turned on.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>ENOSYS</para>
-</entry><entry
- align="char">
-<para>Function not available for this device.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 </section>
 
 <section id="FE_READ_UNCORRECTED_BLOCKS">
@@ -930,29 +842,8 @@ typedef enum fe_hierarchy {
  so far.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
+
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EFAULT</para>
-</entry><entry
- align="char">
-<para>ublocks points to invalid address.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>ENOSYS</para>
-</entry><entry
- align="char">
-<para>Function not available for this device.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 </section>
 
 <section id="FE_SET_FRONTEND">
@@ -1005,23 +896,10 @@ typedef enum fe_hierarchy {
 <para>Points to parameters for tuning operation.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
+
 &return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EFAULT</para>
-</entry><entry
- align="char">
-<para>p points to invalid address.</para>
-</entry>
- </row><row><entry
- align="char">
 <para>EINVAL</para>
 </entry><entry
  align="char">
@@ -1078,23 +956,8 @@ typedef enum fe_hierarchy {
  </row></tbody></tgroup></informaltable>
 
 &return-value-dvb;
-
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EFAULT</para>
-</entry><entry
- align="char">
-<para>p points to invalid address.</para>
-</entry>
- </row><row><entry
- align="char">
 <para>EINVAL</para>
 </entry><entry
  align="char">
@@ -1181,20 +1044,6 @@ typedef enum fe_hierarchy {
 &return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EFAULT</para>
-</entry><entry
- align="char">
-<para>ev points to invalid address.</para>
-</entry>
- </row><row><entry
- align="char">
 <para>EWOULDBLOCK</para>
 </entry><entry
  align="char">
@@ -1206,11 +1055,6 @@ typedef enum fe_hierarchy {
 <para>EOVERFLOW</para>
 </entry><entry
  align="char">
-</entry>
- </row><row><entry
- align="char">
-</entry><entry
- align="char">
 <para>Overflow in event queue - one or more events were lost.</para>
 </entry>
 </row></tbody></tgroup></informaltable>
@@ -1264,21 +1108,6 @@ typedef enum fe_hierarchy {
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EFAULT</para>
-</entry><entry
- align="char">
-<para>info points to invalid address.</para>
-</entry>
-</row></tbody></tgroup></informaltable>
 </section>
 
 <section id="FE_DISEQC_RESET_OVERLOAD">
@@ -1322,28 +1151,6 @@ typedef enum fe_hierarchy {
  </row></tbody></tgroup></informaltable>
 
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EPERM</para>
-</entry><entry
- align="char">
-<para>Permission denied (needs read/write access).</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error in the device driver.</para>
-</entry>
-</row></tbody></tgroup></informaltable>
 </section>
 
 <section id="FE_DISEQC_SEND_MASTER_CMD">
@@ -1394,43 +1201,6 @@ typedef enum fe_hierarchy {
  </row></tbody></tgroup></informaltable>
 
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EFAULT</para>
-</entry><entry
- align="char">
-<para>Seq points to an invalid address.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINVAL</para>
-</entry><entry
- align="char">
-<para>The data structure referred to by seq is invalid in some
- way.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EPERM</para>
-</entry><entry
- align="char">
-<para>Permission denied (needs read/write access).</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error in the device driver.</para>
-</entry>
-</row></tbody></tgroup></informaltable>
 </section>
 
 <section id="FE_DISEQC_RECV_SLAVE_REPLY">
@@ -1481,43 +1251,6 @@ typedef enum fe_hierarchy {
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EFAULT</para>
-</entry><entry
- align="char">
-<para>Seq points to an invalid address.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINVAL</para>
-</entry><entry
- align="char">
-<para>The data structure referred to by seq is invalid in some
- way.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EPERM</para>
-</entry><entry
- align="char">
-<para>Permission denied (needs read/write access).</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error in the device driver.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 </section>
 
 <section id="FE_DISEQC_SEND_BURST">
@@ -1566,43 +1299,6 @@ typedef enum fe_hierarchy {
  </row></tbody></tgroup></informaltable>
 
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EFAULT</para>
-</entry><entry
- align="char">
-<para>Seq points to an invalid address.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINVAL</para>
-</entry><entry
- align="char">
-<para>The data structure referred to by seq is invalid in some
- way.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EPERM</para>
-</entry><entry
- align="char">
-<para>Permission denied (needs read/write access).</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error in the device driver.</para>
-</entry>
-</row></tbody></tgroup></informaltable>
 </section>
 
 <section id="FE_SET_TONE">
@@ -1649,42 +1345,6 @@ typedef enum fe_hierarchy {
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>ENODEV</para>
-</entry><entry
- align="char">
-<para>Device driver not loaded/available.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EBUSY</para>
-</entry><entry
- align="char">
-<para>Device or resource busy.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINVAL</para>
-</entry><entry
- align="char">
-<para>Invalid argument.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EPERM</para>
-</entry><entry
- align="char">
-<para>File not opened with read permissions.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error in the device driver.</para>
-</entry>
-</row></tbody></tgroup></informaltable>
 </section>
 
 <section id="FE_SET_VOLTAGE">
@@ -1733,42 +1393,6 @@ typedef enum fe_hierarchy {
  </row></tbody></tgroup></informaltable>
 
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>ENODEV</para>
-</entry><entry
- align="char">
-<para>Device driver not loaded/available.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EBUSY</para>
-</entry><entry
- align="char">
-<para>Device or resource busy.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINVAL</para>
-</entry><entry
- align="char">
-<para>Invalid argument.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EPERM</para>
-</entry><entry
- align="char">
-<para>File not opened with read permissions.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error in the device driver.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 </section>
 
 <section id="FE_ENABLE_HIGH_LNB_VOLTAGE">
@@ -1818,42 +1442,6 @@ typedef enum fe_hierarchy {
  </row></tbody></tgroup></informaltable>
 
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>ENODEV</para>
-</entry><entry
- align="char">
-<para>Device driver not loaded/available.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EBUSY</para>
-</entry><entry
- align="char">
-<para>Device or resource busy.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINVAL</para>
-</entry><entry
- align="char">
-<para>Invalid argument.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EPERM</para>
-</entry><entry
- align="char">
-<para>File not opened with read permissions.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error in the device driver.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 </section>
 
 <section id="FE_SET_FRONTEND_TUNE_MODE">
@@ -1886,10 +1474,6 @@ FE_TUNE_MODE_ONESHOT When set, this flag will disable any zigzagging or other "n
  </row></tbody></tgroup></informaltable>
 
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row>
-<entry align="char"><para>EINVAL</para></entry>
-<entry align="char"><para>Invalid argument.</para></entry>
- </row></tbody></tgroup></informaltable>
 </section>
 
 <section id="FE_DISHNETWORK_SEND_LEGACY_CMD">
@@ -1924,11 +1508,6 @@ sends the specified raw cmd to the dish via DISEqC.
  </row></tbody></tgroup></informaltable>
 
 &return-value-dvb;
-<informaltable><tgroup cols="1"><tbody><row>
-<entry align="char">
-	<para>There are no errors in use for this call</para>
-</entry>
-</row></tbody></tgroup></informaltable>
 </section>
 
 </section>
diff --git a/Documentation/DocBook/media/v4l/gen-errors.xml b/Documentation/DocBook/media/v4l/gen-errors.xml
index 3e6ddd9..dedcc90 100644
--- a/Documentation/DocBook/media/v4l/gen-errors.xml
+++ b/Documentation/DocBook/media/v4l/gen-errors.xml
@@ -8,7 +8,7 @@
 	<!-- Keep it ordered alphabetically -->
       <row>
 	<entry>EBADF</entry>
-	<entry><parameter>fd</parameter> is not a valid open file descriptor.</entry>
+	<entry>The file descriptor is not a valid.</entry>
       </row>
       <row>
 	<entry>EBUSY</entry>
@@ -21,18 +21,20 @@
       </row>
       <row>
 	<entry>EFAULT</entry>
-	<entry><parameter>fd</parameter> is not a valid open file descriptor.</entry>
+	<entry>There was a failure while copying data from/to userspace.</entry>
       </row>
       <row>
 	<entry>EINVAL</entry>
-	<entry>One or more of the ioctl parameters are invalid. This is a widely
-	       error code. see the individual ioctl requests for actual causes.</entry>
+	<entry>One or more of the ioctl parameters are invalid or out of the
+	       allowed range. This is a widely error code. See the individual
+	       ioctl requests for specific causes.</entry>
       </row>
       <row>
 	<entry>EINVAL or ENOTTY</entry>
 	<entry>The ioctl is not supported by the driver, actually meaning that
 	       the required functionality is not available, or the file
-	       descriptor is not for a media device.</entry>
+	       descriptor is not for a media device. The usage of EINVAL is
+	       deprecated and will be fixed on a latter patch.</entry>
       </row>
       <row>
         <entry>ENODEV</entry>
@@ -49,6 +51,17 @@
 	       for periodic transfers (up to 80% of the USB bandwidth).</entry>
       </row>
       <row>
+	<entry>ENOSYS or EOPNOTSUPP</entry>
+	<entry>Function not available for this device (dvb API only. Will likely
+	       be replaced anytime soon by ENOTTY).</entry>
+      </row>
+      <row>
+	<entry>EPERM</entry>
+	<entry>Permission denied. Can be returned if the device needs write
+		permission, or some special capabilities is needed
+		(e. g. root)</entry>
+      </row>
+      <row>
 	<entry>EWOULDBLOCK</entry>
 	<entry>Operation would block. Used when the ioctl would need to wait
 	       for an event, but the device was opened in non-blocking mode.</entry>
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH RFCv3 16/17] [media] v4l2 core: return -ENOTTY if an ioctl doesn't exist
       [not found] <cover.1309974026.git.mchehab@redhat.com>
                   ` (15 preceding siblings ...)
  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 ` Mauro Carvalho Chehab
  16 siblings, 0 replies; 23+ messages in thread
From: Mauro Carvalho Chehab @ 2011-07-06 18:04 UTC (permalink / raw)
  Cc: Linux Media Mailing List, Linux Kernel Mailing List

Currently, -EINVAL is used to return either when an IOCTL is not
implemented, or if the ioctl was not implemented.

Note: Drivers that don't use video_ioctl2, will need extra patches.

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

diff --git a/Documentation/DocBook/media/v4l/gen-errors.xml b/Documentation/DocBook/media/v4l/gen-errors.xml
index dedcc90..8117c60 100644
--- a/Documentation/DocBook/media/v4l/gen-errors.xml
+++ b/Documentation/DocBook/media/v4l/gen-errors.xml
@@ -30,13 +30,6 @@
 	       ioctl requests for specific causes.</entry>
       </row>
       <row>
-	<entry>EINVAL or ENOTTY</entry>
-	<entry>The ioctl is not supported by the driver, actually meaning that
-	       the required functionality is not available, or the file
-	       descriptor is not for a media device. The usage of EINVAL is
-	       deprecated and will be fixed on a latter patch.</entry>
-      </row>
-      <row>
         <entry>ENODEV</entry>
 	<entry>Device not found or was removed.</entry>
       </row>
@@ -45,6 +38,12 @@
 	<entry>There's not enough memory to handle the desired operation.</entry>
       </row>
       <row>
+	<entry>ENOTTY</entry>
+	<entry>The ioctl is not supported by the driver, actually meaning that
+	       the required functionality is not available, or the file
+	       descriptor is not for a media device.</entry>
+      </row>
+      <row>
 	<entry>ENOSPC</entry>
 	<entry>On USB devices, the stream ioctl's can return this error, meaning
 	       that this request would overcommit the usb bandwidth reserved
diff --git a/Documentation/DocBook/media/v4l/v4l2.xml b/Documentation/DocBook/media/v4l/v4l2.xml
index c5ee398..43386a6 100644
--- a/Documentation/DocBook/media/v4l/v4l2.xml
+++ b/Documentation/DocBook/media/v4l/v4l2.xml
@@ -132,7 +132,9 @@ applications. -->
 	<date>2011-06-27</date>
 	<authorinitials>mcc, po</authorinitials>
 	<revremark>Documented that VIDIOC_QUERYCAP now returns a per-subsystem version instead of a per-driver one.</revremark>
+	<revremark>Standardize an error code for invalid ioctl.</revremark>
       </revision>
+
       <revision>
 	<revnumber>2.6.39</revnumber>
 	<date>2011-03-01</date>
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c
index f9aebac..4253276 100644
--- a/drivers/media/video/v4l2-ioctl.c
+++ b/drivers/media/video/v4l2-ioctl.c
@@ -543,12 +543,12 @@ static long __video_do_ioctl(struct file *file,
 	struct v4l2_fh *vfh = NULL;
 	struct v4l2_format f_copy;
 	int use_fh_prio = 0;
-	long ret = -EINVAL;
+	long ret = -ENOTTY;
 
 	if (ops == NULL) {
 		printk(KERN_WARNING "videodev: \"%s\" has no ioctl_ops.\n",
 				vfd->name);
-		return -EINVAL;
+		return ret;
 	}
 
 	if ((vfd->debug & V4L2_DEBUG_IOCTL) &&
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH RFCv3 15/17] [media] DocBook/dvb: Use generic descriptions for the video API
       [not found] <cover.1309974026.git.mchehab@redhat.com>
                   ` (14 preceding siblings ...)
  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 ` 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
  16 siblings, 0 replies; 23+ messages in thread
From: Mauro Carvalho Chehab @ 2011-07-06 18:04 UTC (permalink / raw)
  Cc: Linux Media Mailing List, Linux Kernel Mailing List

While here, removes the bogus EINTERNAL error codes.

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

diff --git a/Documentation/DocBook/media/dvb/video.xml b/Documentation/DocBook/media/dvb/video.xml
index 0b1b662..25fb823 100644
--- a/Documentation/DocBook/media/dvb/video.xml
+++ b/Documentation/DocBook/media/dvb/video.xml
@@ -593,22 +593,6 @@ role="subsection"><title>VIDEO_STOP</title>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error, possibly in the communication with the
- DVB subsystem.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 
 </section><section id="VIDEO_PLAY"
 role="subsection"><title>VIDEO_PLAY</title>
@@ -645,22 +629,6 @@ role="subsection"><title>VIDEO_PLAY</title>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error, possibly in the communication with the
- DVB subsystem.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 
 </section><section id="VIDEO_FREEZE"
 role="subsection"><title>VIDEO_FREEZE</title>
@@ -701,22 +669,6 @@ role="subsection"><title>VIDEO_FREEZE</title>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error, possibly in the communication with the
- DVB subsystem.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 
 </section><section id="VIDEO_CONTINUE"
 role="subsection"><title>VIDEO_CONTINUE</title>
@@ -753,22 +705,6 @@ role="subsection"><title>VIDEO_CONTINUE</title>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error, possibly in the communication with the
- DVB subsystem.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 
 </section><section id="VIDEO_SELECT_SOURCE"
 role="subsection"><title>VIDEO_SELECT_SOURCE</title>
@@ -815,22 +751,6 @@ role="subsection"><title>VIDEO_SELECT_SOURCE</title>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error, possibly in the communication with the
- DVB subsystem.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 
 </section><section id="VIDEO_SET_BLANK"
 role="subsection"><title>VIDEO_SET_BLANK</title>
@@ -880,29 +800,6 @@ role="subsection"><title>VIDEO_SET_BLANK</title>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error, possibly in the communication with the
- DVB subsystem.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINVAL</para>
-</entry><entry
- align="char">
-<para>Illegal input parameter</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 
 </section><section id="VIDEO_GET_STATUS"
 role="subsection"><title>VIDEO_GET_STATUS</title>
@@ -947,29 +844,6 @@ role="subsection"><title>VIDEO_GET_STATUS</title>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error, possibly in the communication with the
- DVB subsystem.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EFAULT</para>
-</entry><entry
- align="char">
-<para>status points to invalid address</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 
 </section><section id="VIDEO_GET_EVENT"
 role="subsection"><title>VIDEO_GET_EVENT</title>
@@ -1025,20 +899,6 @@ role="subsection"><title>VIDEO_GET_EVENT</title>
 &return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EFAULT</para>
-</entry><entry
- align="char">
-<para>ev points to invalid address</para>
-</entry>
- </row><row><entry
- align="char">
 <para>EWOULDBLOCK</para>
 </entry><entry
  align="char">
@@ -1050,11 +910,6 @@ role="subsection"><title>VIDEO_GET_EVENT</title>
 <para>EOVERFLOW</para>
 </entry><entry
  align="char">
-</entry>
- </row><row><entry
- align="char">
-</entry><entry
- align="char">
 <para>Overflow in event queue - one or more events were lost.</para>
 </entry>
  </row></tbody></tgroup></informaltable>
@@ -1105,28 +960,6 @@ role="subsection"><title>VIDEO_SET_DISPLAY_FORMAT</title>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINVAL</para>
-</entry><entry
- align="char">
-<para>Illegal parameter format.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 
 </section><section id="VIDEO_STILLPICTURE"
 role="subsection"><title>VIDEO_STILLPICTURE</title>
@@ -1174,28 +1007,6 @@ role="subsection"><title>VIDEO_STILLPICTURE</title>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EFAULT</para>
-</entry><entry
- align="char">
-<para>sp points to an invalid iframe.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 
 </section><section id="VIDEO_FAST_FORWARD"
 role="subsection"><title>VIDEO_FAST_FORWARD</title>
@@ -1242,32 +1053,11 @@ role="subsection"><title>VIDEO_FAST_FORWARD</title>
 &return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error.</para>
-</entry>
- </row><row><entry
- align="char">
 <para>EPERM</para>
 </entry><entry
  align="char">
 <para>Mode VIDEO_SOURCE_MEMORY not selected.</para>
 </entry>
- </row><row><entry
- align="char">
-<para>EINVAL</para>
-</entry><entry
- align="char">
-<para>Illegal parameter format.</para>
-</entry>
  </row></tbody></tgroup></informaltable>
 
 </section><section id="VIDEO_SLOWMOTION"
@@ -1315,32 +1105,11 @@ role="subsection"><title>VIDEO_SLOWMOTION</title>
 &return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error.</para>
-</entry>
- </row><row><entry
- align="char">
 <para>EPERM</para>
 </entry><entry
  align="char">
 <para>Mode VIDEO_SOURCE_MEMORY not selected.</para>
 </entry>
- </row><row><entry
- align="char">
-<para>EINVAL</para>
-</entry><entry
- align="char">
-<para>Illegal parameter format.</para>
-</entry>
  </row></tbody></tgroup></informaltable>
 
 </section><section id="VIDEO_GET_CAPABILITIES"
@@ -1388,21 +1157,6 @@ role="subsection"><title>VIDEO_GET_CAPABILITIES</title>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EFAULT</para>
-</entry><entry
- align="char">
-<para>cap points to an invalid iframe.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 
 </section><section id="VIDEO_SET_ID"
 role="subsection"><title>VIDEO_SET_ID</title>
@@ -1449,20 +1203,6 @@ role="subsection"><title>VIDEO_SET_ID</title>
 &return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINTERNAL</para>
-</entry><entry
- align="char">
-<para>Internal error.</para>
-</entry>
- </row><row><entry
- align="char">
 <para>EINVAL</para>
 </entry><entry
  align="char">
@@ -1504,14 +1244,6 @@ role="subsection"><title>VIDEO_CLEAR_BUFFER</title>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 
 </section><section id="VIDEO_SET_STREAMTYPE"
 role="subsection"><title>VIDEO_SET_STREAMTYPE</title>
@@ -1557,21 +1289,6 @@ role="subsection"><title>VIDEO_SET_STREAMTYPE</title>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINVAL</para>
-</entry><entry
- align="char">
-<para>type is not a valid or supported stream type.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 
 </section><section id="VIDEO_SET_FORMAT"
 role="subsection"><title>VIDEO_SET_FORMAT</title>
@@ -1619,13 +1336,6 @@ role="subsection"><title>VIDEO_SET_FORMAT</title>
 &return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row><row><entry
- align="char">
 <para>EINVAL</para>
 </entry><entry
  align="char">
@@ -1680,13 +1390,6 @@ role="subsection"><title>VIDEO_SET_SYSTEM</title>
 &return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row><row><entry
- align="char">
 <para>EINVAL</para>
 </entry><entry
  align="char">
@@ -1737,21 +1440,6 @@ role="subsection"><title>VIDEO_SET_HIGHLIGHT</title>
 </entry>
  </row></tbody></tgroup></informaltable>
 &return-value-dvb;
-<informaltable><tgroup cols="2"><tbody><row><entry
- align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor.</para>
-</entry>
- </row><row><entry
- align="char">
-<para>EINVAL</para>
-</entry><entry
- align="char">
-<para>input is not a valid highlight setting.</para>
-</entry>
- </row></tbody></tgroup></informaltable>
 
 </section><section id="VIDEO_SET_SPU"
 role="subsection"><title>VIDEO_SET_SPU</title>
@@ -1799,13 +1487,6 @@ role="subsection"><title>VIDEO_SET_SPU</title>
 &return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row><row><entry
- align="char">
 <para>EINVAL</para>
 </entry><entry
  align="char">
@@ -1859,13 +1540,6 @@ role="subsection"><title>VIDEO_SET_SPU_PALETTE</title>
 &return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row><row><entry
- align="char">
 <para>EINVAL</para>
 </entry><entry
  align="char">
@@ -1920,13 +1594,6 @@ role="subsection"><title>VIDEO_GET_NAVI</title>
 &return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row><row><entry
- align="char">
 <para>EFAULT</para>
 </entry><entry
  align="char">
@@ -1981,13 +1648,6 @@ role="subsection"><title>VIDEO_SET_ATTRIBUTES</title>
 &return-value-dvb;
 <informaltable><tgroup cols="2"><tbody><row><entry
  align="char">
-<para>EBADF</para>
-</entry><entry
- align="char">
-<para>fd is not a valid open file descriptor</para>
-</entry>
- </row><row><entry
- align="char">
 <para>EINVAL</para>
 </entry><entry
  align="char">
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH RFCv3 03/17] [media] DocBook: Use the generic error code page also for MC API
  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
  0 siblings, 1 reply; 23+ messages in thread
From: Hans Verkuil @ 2011-07-07 15:29 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Linux Media Mailing List; +Cc: Linux Kernel Mailing List

On Wednesday, July 06, 2011 20:03:52 Mauro Carvalho Chehab wrote:
> Instead of having their own generic error codes at the MC API, move
> its section to the generic one and be sure that all media ioctl's
> will point to it.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
> 
> diff --git a/Documentation/DocBook/media/v4l/gen-errors.xml b/Documentation/DocBook/media/v4l/gen-errors.xml
> index 6ef476a..a7f73c9 100644
> --- a/Documentation/DocBook/media/v4l/gen-errors.xml
> +++ b/Documentation/DocBook/media/v4l/gen-errors.xml
> @@ -5,6 +5,11 @@
>    <tgroup cols="2">
>      &cs-str;
>      <tbody valign="top">
> +	<!-- Keep it ordered alphabetically -->
> +      <row>
> +	<entry>EBADF</entry>
> +	<entry><parameter>fd</parameter> is not a valid open file descriptor.</entry>
> +      </row>
>        <row>
>  	<entry>EBUSY</entry>
>  	<entry>The ioctl can't be handled because the device is busy. This is
> @@ -15,7 +20,16 @@
>  	       problem first (typically: stop the stream before retrying).</entry>
>        </row>
>        <row>
> +	<entry>EFAULT</entry>
> +	<entry><parameter>fd</parameter> is not a valid open file descriptor.</entry>

This seems to be a copy-and-paste error. The original text in media-func-ioctl.xml says this:

	  <para><parameter>argp</parameter> references an inaccessible memory
	  area.</para>

> +      </row>
> +      <row>
>  	<entry>EINVAL</entry>
> +	<entry>One or more of the ioctl parameters are invalid. This is a widely

widely -> widely used

> +	       error code. see the individual ioctl requests for actual causes.</entry>

see -> See

Regards,

	Hans

> +      </row>
> +      <row>
> +	<entry>EINVAL or ENOTTY</entry>
>  	<entry>The ioctl is not supported by the driver, actually meaning that
>  	       the required functionality is not available.</entry>
>        </row>
> @@ -25,7 +39,7 @@
>        </row>
>        <row>
>  	<entry>ENOSPC</entry>
> -	<entry>On USB devices, the stream ioctl's can return this error meaning
> +	<entry>On USB devices, the stream ioctl's can return this error, meaning
>  	       that this request would overcommit the usb bandwidth reserved
>  	       for periodic transfers (up to 80% of the USB bandwidth).</entry>
>        </row>
> diff --git a/Documentation/DocBook/media/v4l/media-func-ioctl.xml b/Documentation/DocBook/media/v4l/media-func-ioctl.xml
> index bda8604..e0ee285 100644
> --- a/Documentation/DocBook/media/v4l/media-func-ioctl.xml
> +++ b/Documentation/DocBook/media/v4l/media-func-ioctl.xml
> @@ -63,54 +63,10 @@
>    </refsect1>
>  
>    <refsect1>
> -    <title>Return Value</title>
> -
> -    <para><function>ioctl()</function> returns <returnvalue>0</returnvalue> on
> -    success. On failure, <returnvalue>-1</returnvalue> is returned, and the
> -    <varname>errno</varname> variable is set appropriately. Generic error codes
> -    are listed below, and request-specific error codes are listed in the
> +    &return-value;
> +    <para>Request-specific error codes are listed in the
>      individual requests descriptions.</para>
>      <para>When an ioctl that takes an output or read/write parameter fails,
>      the parameter remains unmodified.</para>
> -
> -    <variablelist>
> -      <varlistentry>
> -	<term><errorcode>EBADF</errorcode></term>
> -	<listitem>
> -	  <para><parameter>fd</parameter> is not a valid open file descriptor.
> -	  </para>
> -	</listitem>
> -      </varlistentry>
> -      <varlistentry>
> -	<term><errorcode>EFAULT</errorcode></term>
> -	<listitem>
> -	  <para><parameter>argp</parameter> references an inaccessible memory
> -	  area.</para>
> -	</listitem>
> -      </varlistentry>
> -      <varlistentry>
> -	<term><errorcode>EINVAL</errorcode></term>
> -	<listitem>
> -	  <para>The <parameter>request</parameter> or the data pointed to by
> -	  <parameter>argp</parameter> is not valid. This is a very common error
> -	  code, see the individual ioctl requests listed in
> -	  <xref linkend="media-user-func" /> for actual causes.</para>
> -	</listitem>
> -      </varlistentry>
> -      <varlistentry>
> -	<term><errorcode>ENOMEM</errorcode></term>
> -	<listitem>
> -	  <para>Insufficient kernel memory was available to complete the
> -	  request.</para>
> -	</listitem>
> -      </varlistentry>
> -      <varlistentry>
> -	<term><errorcode>ENOTTY</errorcode></term>
> -	<listitem>
> -	  <para><parameter>fd</parameter> is  not  associated  with  a character
> -	  special device.</para>
> -	</listitem>
> -      </varlistentry>
> -    </variablelist>
>    </refsect1>
>  </refentry>
> diff --git a/Documentation/DocBook/media/v4l/media-ioc-device-info.xml b/Documentation/DocBook/media/v4l/media-ioc-device-info.xml
> index 1f32373..2ce5214 100644
> --- a/Documentation/DocBook/media/v4l/media-ioc-device-info.xml
> +++ b/Documentation/DocBook/media/v4l/media-ioc-device-info.xml
> @@ -127,7 +127,6 @@
>    </refsect1>
>  
>    <refsect1>
> -    <title>Return value</title>
> -    <para>This function doesn't return specific error codes.</para>
> +    &return-value;
>    </refsect1>
>  </refentry>
> 

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH RFCv3 17/17] [media] return -ENOTTY for unsupported ioctl's at legacy drivers
  2011-07-06 18:03 ` [PATCH RFCv3 17/17] [media] return -ENOTTY for unsupported ioctl's at legacy drivers Mauro Carvalho Chehab
@ 2011-07-07 16:44   ` Mike Isely
  2011-07-11 11:03   ` Laurent Pinchart
  1 sibling, 0 replies; 23+ messages in thread
From: Mike Isely @ 2011-07-07 16:44 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List, Linux Kernel Mailing List


For the pvrusb2 portion of this patch:

Acked-By: Mike Isely <isely@pobox.com>

  -Mike

On Wed, 6 Jul 2011, Mauro Carvalho Chehab wrote:

> 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;
>  	}
>  
> 

-- 

Mike Isely
isely @ isely (dot) net
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH RFCv3 03/17] [media] DocBook: Use the generic error code page also for MC API
  2011-07-07 15:29   ` Hans Verkuil
@ 2011-07-07 17:15     ` Mauro Carvalho Chehab
  2011-07-07 17:28       ` Hans Verkuil
  0 siblings, 1 reply; 23+ messages in thread
From: Mauro Carvalho Chehab @ 2011-07-07 17:15 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: Linux Media Mailing List, Linux Kernel Mailing List

Em 07-07-2011 12:29, Hans Verkuil escreveu:
> On Wednesday, July 06, 2011 20:03:52 Mauro Carvalho Chehab wrote:
>> Instead of having their own generic error codes at the MC API, move
>> its section to the generic one and be sure that all media ioctl's
>> will point to it.
>>
>> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
>>
>> diff --git a/Documentation/DocBook/media/v4l/gen-errors.xml b/Documentation/DocBook/media/v4l/gen-errors.xml
>> index 6ef476a..a7f73c9 100644
>> --- a/Documentation/DocBook/media/v4l/gen-errors.xml
>> +++ b/Documentation/DocBook/media/v4l/gen-errors.xml
>> @@ -5,6 +5,11 @@
>>    <tgroup cols="2">
>>      &cs-str;
>>      <tbody valign="top">
>> +	<!-- Keep it ordered alphabetically -->
>> +      <row>
>> +	<entry>EBADF</entry>
>> +	<entry><parameter>fd</parameter> is not a valid open file descriptor.</entry>
>> +      </row>
>>        <row>
>>  	<entry>EBUSY</entry>
>>  	<entry>The ioctl can't be handled because the device is busy. This is
>> @@ -15,7 +20,16 @@
>>  	       problem first (typically: stop the stream before retrying).</entry>
>>        </row>
>>        <row>
>> +	<entry>EFAULT</entry>
>> +	<entry><parameter>fd</parameter> is not a valid open file descriptor.</entry>
> 
> This seems to be a copy-and-paste error. The original text in media-func-ioctl.xml says this:
> 
> 	  <para><parameter>argp</parameter> references an inaccessible memory
> 	  area.</para>

Ah, yes. Anyway, a latter patch changes it to:

	<entry>EFAULT</entry>
	<entry>There was a failure while copying data from/to userspace.</entry>
      </row>

referencing a parameter name there is a bad thing anyway, as this is now at the common
ioctl error code.

Instead of just using a posix-like error code:
	EFAULT          Bad address (POSIX.1)

I opted to use a more valuable description, explaining the reason for such error,
e. g. that there was a failure at the data copy from/to userspace.

It may be better to change it to:

	<entry>EFAULT</entry>
	<entry>There was a failure while copying data from/to userspace, probably
		caused by an invalid pointer reference.</entry>

I think I'll add the above description at the latter patch.

I was intending to add there the other possible error causes found at V4L/DVB API's
and drivers, but the changes I did took me a longer time than I was expecting
originally.  I'll eventually do that when I have more time. 

It would be really great if we could find some volunteer to help syncing 
the media API specs with the code.

>> +      </row>
>> +      <row>
>>  	<entry>EINVAL</entry>
>> +	<entry>One or more of the ioctl parameters are invalid. This is a widely
> 
> widely -> widely used
> 
>> +	       error code. see the individual ioctl requests for actual causes.</entry>
> 
> see -> See

Fixed. 

Thanks!
Mauro

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH RFCv3 03/17] [media] DocBook: Use the generic error code page also for MC API
  2011-07-07 17:15     ` Mauro Carvalho Chehab
@ 2011-07-07 17:28       ` Hans Verkuil
  2011-07-07 17:46         ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 23+ messages in thread
From: Hans Verkuil @ 2011-07-07 17:28 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List, Linux Kernel Mailing List

On Thursday, July 07, 2011 19:15:24 Mauro Carvalho Chehab wrote:
> Em 07-07-2011 12:29, Hans Verkuil escreveu:
> > On Wednesday, July 06, 2011 20:03:52 Mauro Carvalho Chehab wrote:
> >> Instead of having their own generic error codes at the MC API, move
> >> its section to the generic one and be sure that all media ioctl's
> >> will point to it.
> >>
> >> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
> >>
> >> diff --git a/Documentation/DocBook/media/v4l/gen-errors.xml b/Documentation/DocBook/media/v4l/gen-errors.xml
> >> index 6ef476a..a7f73c9 100644
> >> --- a/Documentation/DocBook/media/v4l/gen-errors.xml
> >> +++ b/Documentation/DocBook/media/v4l/gen-errors.xml
> >> @@ -5,6 +5,11 @@
> >>    <tgroup cols="2">
> >>      &cs-str;
> >>      <tbody valign="top">
> >> +	<!-- Keep it ordered alphabetically -->
> >> +      <row>
> >> +	<entry>EBADF</entry>
> >> +	<entry><parameter>fd</parameter> is not a valid open file descriptor.</entry>
> >> +      </row>
> >>        <row>
> >>  	<entry>EBUSY</entry>
> >>  	<entry>The ioctl can't be handled because the device is busy. This is
> >> @@ -15,7 +20,16 @@
> >>  	       problem first (typically: stop the stream before retrying).</entry>
> >>        </row>
> >>        <row>
> >> +	<entry>EFAULT</entry>
> >> +	<entry><parameter>fd</parameter> is not a valid open file descriptor.</entry>
> > 
> > This seems to be a copy-and-paste error. The original text in media-func-ioctl.xml says this:
> > 
> > 	  <para><parameter>argp</parameter> references an inaccessible memory
> > 	  area.</para>
> 
> Ah, yes. Anyway, a latter patch changes it to:

OK, I missed that. It was a bit confusing to review.

> 
> 	<entry>EFAULT</entry>
> 	<entry>There was a failure while copying data from/to userspace.</entry>
>       </row>
> 
> referencing a parameter name there is a bad thing anyway, as this is now at the common
> ioctl error code.
> 
> Instead of just using a posix-like error code:
> 	EFAULT          Bad address (POSIX.1)
> 
> I opted to use a more valuable description, explaining the reason for such error,
> e. g. that there was a failure at the data copy from/to userspace.
> 
> It may be better to change it to:
> 
> 	<entry>EFAULT</entry>
> 	<entry>There was a failure while copying data from/to userspace, probably
> 		caused by an invalid pointer reference.</entry>
> 
> I think I'll add the above description at the latter patch.
> 
> I was intending to add there the other possible error causes found at V4L/DVB API's
> and drivers, but the changes I did took me a longer time than I was expecting
> originally.  I'll eventually do that when I have more time. 
> 
> It would be really great if we could find some volunteer to help syncing 
> the media API specs with the code.
> 
> >> +      </row>
> >> +      <row>
> >>  	<entry>EINVAL</entry>
> >> +	<entry>One or more of the ioctl parameters are invalid. This is a widely
> > 
> > widely -> widely used
> > 
> >> +	       error code. see the individual ioctl requests for actual causes.</entry>
> > 
> > see -> See
> 
> Fixed. 

OK, with these changes you have my

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

as well for this patch.

Just for my understanding: do you plan on merging this for 3.1? I have no objection to
that. Together with the querycap version changes it is easy to add compatibility support
to libv4l should that be necessary. I'm not convinced there won't be any fallout from
this change, but at least there is a decent way of working around it if needed. And there
is no doubt that -ENOTTY is a much better return code.

When this is merged I'll modify v4l2-compliance, v4l2-ctl (if necessary) and qv4l2.

Regards,

	Hans

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH RFCv3 03/17] [media] DocBook: Use the generic error code page also for MC API
  2011-07-07 17:28       ` Hans Verkuil
@ 2011-07-07 17:46         ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 23+ messages in thread
From: Mauro Carvalho Chehab @ 2011-07-07 17:46 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: Linux Media Mailing List, Linux Kernel Mailing List

Em 07-07-2011 14:28, Hans Verkuil escreveu:
> On Thursday, July 07, 2011 19:15:24 Mauro Carvalho Chehab wrote:
>> Em 07-07-2011 12:29, Hans Verkuil escreveu:
>>> On Wednesday, July 06, 2011 20:03:52 Mauro Carvalho Chehab wrote:
>>>> Instead of having their own generic error codes at the MC API, move
>>>> its section to the generic one and be sure that all media ioctl's
>>>> will point to it.
>>>>
>>>> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
>>>>
>>>> diff --git a/Documentation/DocBook/media/v4l/gen-errors.xml b/Documentation/DocBook/media/v4l/gen-errors.xml
>>>> index 6ef476a..a7f73c9 100644
>>>> --- a/Documentation/DocBook/media/v4l/gen-errors.xml
>>>> +++ b/Documentation/DocBook/media/v4l/gen-errors.xml
>>>> @@ -5,6 +5,11 @@
>>>>    <tgroup cols="2">
>>>>      &cs-str;
>>>>      <tbody valign="top">
>>>> +	<!-- Keep it ordered alphabetically -->
>>>> +      <row>
>>>> +	<entry>EBADF</entry>
>>>> +	<entry><parameter>fd</parameter> is not a valid open file descriptor.</entry>
>>>> +      </row>
>>>>        <row>
>>>>  	<entry>EBUSY</entry>
>>>>  	<entry>The ioctl can't be handled because the device is busy. This is
>>>> @@ -15,7 +20,16 @@
>>>>  	       problem first (typically: stop the stream before retrying).</entry>
>>>>        </row>
>>>>        <row>
>>>> +	<entry>EFAULT</entry>
>>>> +	<entry><parameter>fd</parameter> is not a valid open file descriptor.</entry>
>>>
>>> This seems to be a copy-and-paste error. The original text in media-func-ioctl.xml says this:
>>>
>>> 	  <para><parameter>argp</parameter> references an inaccessible memory
>>> 	  area.</para>
>>
>> Ah, yes. Anyway, a latter patch changes it to:
> 
> OK, I missed that. It was a bit confusing to review.

Yeah. Documentation patches are harder to handle than normal patches. I did several
changes on the existing patches, but perfecting each patch individually will probably
take forever.

>>
>> 	<entry>EFAULT</entry>
>> 	<entry>There was a failure while copying data from/to userspace.</entry>
>>       </row>
>>
>> referencing a parameter name there is a bad thing anyway, as this is now at the common
>> ioctl error code.
>>
>> Instead of just using a posix-like error code:
>> 	EFAULT          Bad address (POSIX.1)
>>
>> I opted to use a more valuable description, explaining the reason for such error,
>> e. g. that there was a failure at the data copy from/to userspace.
>>
>> It may be better to change it to:
>>
>> 	<entry>EFAULT</entry>
>> 	<entry>There was a failure while copying data from/to userspace, probably
>> 		caused by an invalid pointer reference.</entry>
>>
>> I think I'll add the above description at the latter patch.
>>
>> I was intending to add there the other possible error causes found at V4L/DVB API's
>> and drivers, but the changes I did took me a longer time than I was expecting
>> originally.  I'll eventually do that when I have more time. 
>>
>> It would be really great if we could find some volunteer to help syncing 
>> the media API specs with the code.
>>
>>>> +      </row>
>>>> +      <row>
>>>>  	<entry>EINVAL</entry>
>>>> +	<entry>One or more of the ioctl parameters are invalid. This is a widely
>>>
>>> widely -> widely used
>>>
>>>> +	       error code. see the individual ioctl requests for actual causes.</entry>
>>>
>>> see -> See
>>
>> Fixed. 
> 
> OK, with these changes you have my
> 
> Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
> 
> as well for this patch.

Thanks!

> Just for my understanding: do you plan on merging this for 3.1? I have no objection to
> that. Together with the querycap version changes it is easy to add compatibility support
> to libv4l should that be necessary. I'm not convinced there won't be any fallout from
> this change, but at least there is a decent way of working around it if needed. And there
> is no doubt that -ENOTTY is a much better return code.

Yes, that's my plan. Having both patch series merged together seemed a good idea to me, as
it becomes easier for applications to benefit of that.
> 
> When this is merged I'll modify v4l2-compliance, v4l2-ctl (if necessary) and qv4l2.

OK.

> 
> Regards,
> 
> 	Hans


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH RFCv3 17/17] [media] return -ENOTTY for unsupported ioctl's at legacy drivers
  2011-07-06 18:03 ` [PATCH RFCv3 17/17] [media] return -ENOTTY for unsupported ioctl's at legacy drivers Mauro Carvalho Chehab
  2011-07-07 16:44   ` Mike Isely
@ 2011-07-11 11:03   ` Laurent Pinchart
  1 sibling, 0 replies; 23+ messages in thread
From: Laurent Pinchart @ 2011-07-11 11:03 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Linux Kernel Mailing List

On Wednesday 06 July 2011 20:03:49 Mauro Carvalho Chehab wrote:
> 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>

For the uvcvide portion of this patch:

Acked-By: Laurent Pinchart <laurent.pinchart@ideasonboard.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;
>  	}

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2011-07-11 11:02 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1309974026.git.mchehab@redhat.com>
2011-07-06 18:03 ` [PATCH RFCv3 17/17] [media] return -ENOTTY for unsupported ioctl's at legacy drivers Mauro Carvalho Chehab
2011-07-07 16:44   ` Mike Isely
2011-07-11 11:03   ` Laurent Pinchart
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 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 04/17] [media] DocBook/media-ioc-setup-link.xml: Remove EBUSY 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 09/17] [media] nxt6000: i2c bus error should return -EIO 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: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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).